From e3598eddc3ec9a3deb321a2c04803246db4abb84 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sun, 8 Nov 2026 06:43:18 +0800 Subject: [mubios] Add ATA Signed-off-by: Richard Qin --- mubios/core/post.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'mubios/core/post.c') 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"); } -- cgit v1.2.3