Add MBR partition driver
- Scan sector 0 of all hdd devices for MBR signature (0xAA55) - Parse 4 partition entries, register non-empty ones as sub-devices - Sub-devices named hddNmbrY (e.g., hdd1mbr1) via devicefs - LBA translation: sub-device reads/writes offset by partition start LBA - Partition type constants for FAT12/16/32, Linux, NTFS, etc. - IDE improvements: floating bus detection (0xFF), channel presence check - Tested: detects FAT32 LBA partition (type=0x0C) on test disk - Check off devicefs, IDE, MBR in README
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "vfs.h"
|
||||
#include "initrd_fs.h"
|
||||
#include "devicefs.h"
|
||||
#include "mbr.h"
|
||||
#include "keyboard.h"
|
||||
#include "framebuffer.h"
|
||||
|
||||
@@ -286,6 +287,10 @@ void kernel_main(uint32_t magic, uint32_t addr) {
|
||||
EARLY_PRINT("DRV ");
|
||||
offset_print("Drivers initialized\n");
|
||||
|
||||
/* Scan for MBR partitions on detected hard drives */
|
||||
init_mbr();
|
||||
offset_print("MBR scan complete\n");
|
||||
|
||||
/* At this point the VGA driver has been initialized and taken over
|
||||
* the display. The early VGA text is no longer visible. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user