BIOS Read Sector
Alan Ng <[email protected]> Sat, 20 Jan 2018 09:20:04 +0000
| Newsgroups | gmane.comp.emulators.bochs.devel |
|---|---|
| Message-ID | <PS1PR06MB172117840D4E37155673C415D2EE0@PS1PR06MB1721.apcprd06.prod.outlook.com> |
Hi all,
I have a piece of assembly code that is the boot sector of the hard disk, and it loads the 2nd sector. But reading sector with the BIOS does not work. Please help.
See the code below:
.code16
.global _start
.text
_start:
jmp LoadKernel
loop:
jmp loop
StartKernel:
# jmp to kernel
mov $0x7e00, %ax
jmp *%ax
LoadKernel:
# BIOS Read Sector
mov $0, %ax
mov %ax, %es # data buffer
mov $0x7e00, %bx # data buffer
mov $0x02, %ah
mov 1, %al # number of sector to read
mov $0, %ch # cylinder number
mov $2, %cl # sector number
mov $0x0, %dh # head number
mov $0x1, %dl # drive number
int $0x13
jmp StartKernel
.section .bootsig
.byte 0, 0
.byte 0x55, 0xaa
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
bochs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bochs-developers