让bios在引导时打印hello world

本文介绍了如何利用BIOS中断INT 10h在操作系统引导时在屏幕上打印'Hello World'。通过设置中断参数,如AH=0x13指定打印字符串功能,并获取光标位置(使用INT 0x03)来确保打印在屏幕合适的位置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

BIOS 中断

BIOS 中断调用( BIOS interrupt calls),为一些软件提供使用BIOS 上的一些功能.一些操作系统在系统引导时也使用BIOS以检测并初始化硬件资源.

需要使用的中断

主要使用INT 10h 中断,是一个视频服务中断.

The BIOS receives requests to perform functions through software interrupts. Software interrupts, generated by the operating system or by a user application, are generated with INT nnh instructions, where nnh is a number that is assigned to a specific type of service, such as 16h for keyboard input, 10h for video output, or 13h for disk I/O.

BIOS通过软件中断接收执行功能的请求。软件使用INT nnh生成由操作系统或用户应用程序生成的中断指令,其中nnh是分配给特定类型服务的数字,例如16h键盘输入,10h用于视频输出,或13h用于磁盘I / O.

INT 10h 中断工作原理

EMBEDDED BIOS actually begins handling an INT 10h request in its CONIO module, which determines whether the video should be redirected over a serial link.

If CONIO determines that the INT 10h service should not be redirected to a serial device, then it passes control to one of the modules that handle video controllers, such as module VIDEO, which manipulates the 6845 CRT controller registers directly to manage the display. Actual writing of data to the video screen and reading characters from the screen is accomplished by memory reads and writes to video regeneration memory.

EMBEDDED BIOS实际上开始在其CONIO模块中处理INT 10h请求时,将确定视频是否应通过串行链接重定向。如果CONIO确定INT 10h服务不应重定向到串行设备,那么它会将控制,传递到处理视频控制器的模块之一,例如模块VIDEO.其中直接操作6845 CRT控制器寄存器来管理显示器.实

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值