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/include | |
| 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/include')
| -rw-r--r-- | mubios/include/bios.h | 2 | ||||
| -rw-r--r-- | mubios/include/io.h | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/mubios/include/bios.h b/mubios/include/bios.h index eee22e8..7d2d447 100644 --- a/mubios/include/bios.h +++ b/mubios/include/bios.h @@ -50,4 +50,6 @@ void ioapic_init (void); void ivt_init (void); +u8 ata_read_sector28 (u32 lba, u16 *buffer); + #endif // MUBIOS_BIOS_H diff --git a/mubios/include/io.h b/mubios/include/io.h index 8b50508..cedd1c1 100644 --- a/mubios/include/io.h +++ b/mubios/include/io.h @@ -40,4 +40,14 @@ io_in8 (u16 port) return value; } +static inline u16 +io_in16 (u16 port) +{ + u16 value; + + __asm__ volatile ("inw %1, %0" : "=a"(value) : "dN"(port)); + + return value; +} + #endif // MUBIOS_IO_H |
