TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: An HelloWorld x86-Bootloader

5 点作者 filippofinke超过 3 年前

2 条评论

smoppi超过 3 年前
A hello world for an IBM PC compatible does not require much. Sadly UEFI has made everything exponentially more complex. If you want to be more minimalistic, this also works with if the BIOS is newer than 1&#x2F;10&#x2F;86 (written in NASM syntax):<p>[org 0x7c00] ; code offset<p>xor dx, dx ; row 0, col 0<p>mov ds, dx ; set data segment to 0<p>mov ax, 0x1300 ; ah = 0x13 (write string), al = 0x00 (write mode)<p>mov bx, 0x0007 ; bh = video page number (0), bl = attribute byte<p>mov cx, 11 ; string len: 11 bytes<p>mov es, dx ; ES:BP = pointer to string<p>mov bp, message<p>int 0x10 ; interrupt 0x10<p>end: ; do nothing to prevent crashing<p>jmp end ; (cli &amp; hlt also works)<p>message: db &quot;Hello world&quot;<p>times 0x01FE-($-$$) db 0 ; padding<p>dw 0xAA55 ; boot sector signature
sim7c00超过 3 年前
loved getting into this stuff, still making my own os years later (dreamy project...). Want to say there&#x27;s so many things wrong with small examples like this, despite the examples themselves being wonderful like this one.<p>For example, most don&#x27;t include a partition table, which is needed if you use AHCI controller instead of IDE. (so depending on your hardware of vm&#x2F;emu configuration it won&#x27;t work at all)