diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-11-08 06:43:18 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-11-08 06:43:18 +0800 |
| commit | e3598eddc3ec9a3deb321a2c04803246db4abb84 (patch) | |
| tree | 71d9b4e53ae08fa04e3395f49504012461e8bf5a /mubios/core/post.c | |
| parent | 9ffbfc713f9e258bacdfb601293512ecd51d1733 (diff) | |
| download | rcc-project-e3598eddc3ec9a3deb321a2c04803246db4abb84.tar.gz rcc-project-e3598eddc3ec9a3deb321a2c04803246db4abb84.tar.xz | |
[mubios] Add ATA
Signed-off-by: Richard Qin <richard.qin.x@gmail.com>
Diffstat (limited to 'mubios/core/post.c')
| -rw-r--r-- | mubios/core/post.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mubios/core/post.c b/mubios/core/post.c index a37f192..076d262 100644 --- a/mubios/core/post.c +++ b/mubios/core/post.c @@ -36,5 +36,14 @@ post_main (void) pit_init (); ioapic_init (); - serial_write ("mubios: IVT/PIC/PIT initialized\r\n"); + volatile u8 *mbr; + u8 ata_status; + + mbr = (volatile u8 *)0x00007C00u; + ata_status = ata_read_sector28 (0, (u16 *)mbr); + + if (ata_status == 0 && mbr[0x01FE] == 0x55 && mbr[0x01FF] == 0xAA) + serial_write ("mubios: MBR loaded\r\n"); + else + serial_write ("mubios: MBR read failed\r\n"); } |
