x86 上裸机程序的 BIOS [英] BIOS for baremetal programs on x86

查看:23
本文介绍了x86 上裸机程序的 BIOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 BIOS 中断 INT10 是个好主意吗?还是我应该考虑使用 coreboot、UFEI 或 openFirmware?这些兼容吗?我应该用什么来显示到屏幕上?

解决方案

你在这里混淆了几个完全不相关的事情.

  • Coreboot 是 PC BIOS 的替代方案,并非适用于所有主板,必须由用户专门安装.它必须始终运行有效负载,这可能是 Linux 内核之类的东西,也可能是 SeaBIOS 之类的开源 PC BIOS(此时,它在很大程度上与任何其他 PC BIOS 没有区别).>

  • UEFI 是 PC BIOS 的替代品,它更先进,但编码难度相当大.它几乎总是包含标准 PC BIOS 的兼容性例程.

  • 开放固件大致相当于一些其他平台上使用的 PC BIOS,包括 PowerPC Mac 和一些 Sun 系统.据我所知,它从未在 x86 系统上使用过,因此您几乎肯定对它不感兴趣.

如果您正在为裸机 x86 系统编程,那么中断 10h 可能是最佳选择.下一个要考虑的替代方案是直接访问 VGA 硬件.

Is it a good idea to use the BIOS interrupts INT10? Or should I consider coreboot, UFEI or openFirmware? Are these compatible? What should I use to display to the screen?

解决方案

You're mixing up a couple of entirely unrelated things here.

  • Coreboot is an alternative to the PC BIOS which is not available for all motherboards, and which must be specifically installed by the user. It must always run a payload, which may be something like the Linux kernel, or an open-source PC BIOS such as SeaBIOS (at which point, it's largely indistinguishable from any other PC BIOS).

  • UEFI is an alternative to the PC BIOS which is more advanced, but considerably harder to code for. It almost always contains compatibility routines for the standard PC BIOS.

  • Open Firmware is a rough equivalent to the PC BIOS used on some other platforms, including PowerPC Macs and some Sun systems. It's never been used on an x86 system that I'm aware of, so it's almost certainly uninteresting to you.

If you are programming for a bare-metal x86 system, then interrupt 10h is probably the way to go. The next alternative to consider would be accessing the VGA hardware directly.

这篇关于x86 上裸机程序的 BIOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆