Basic idea's are created for the storage solution
- Added boot device info parsing to the kernel - Added a pointer in the kernel to our pre-kernel BootInfo structure - Created a layout for the FAT driver - Created a layout for the virtual filesystem - Separated IDE driver from the basic atapio driver. This will ensure we are not using one or the other - The create_harddrive shell script will now actually build a harddrive image of the kernel - The virtual filesystem initializes and creates a filesystem structure for every FAT16 partition in the master boot record
This commit is contained in:
@ -14,11 +14,11 @@
|
||||
#include "terminal/kterm.h"
|
||||
#include "interrupts/idt.h"
|
||||
#include "serial.h"
|
||||
#include "storage/vfs/VFS.h"
|
||||
#include "../CoreLib/Memory.h"
|
||||
#include "storage/vfs/vfs.h"
|
||||
|
||||
extern "C" void LoadGlobalDescriptorTable();
|
||||
extern "C" void jump_usermode();
|
||||
extern BootInfoBlock* BIB;
|
||||
|
||||
extern "C" void kernel ()
|
||||
{
|
||||
@ -26,7 +26,6 @@ extern "C" void kernel ()
|
||||
init_serial();
|
||||
kterm_init();
|
||||
|
||||
|
||||
setup_tss();
|
||||
initGDT();
|
||||
initidt();
|
||||
@ -41,12 +40,33 @@ extern "C" void kernel ()
|
||||
pit_initialise();
|
||||
ACPI::initialize();
|
||||
|
||||
//PCI::Scan();
|
||||
PCI::Scan();
|
||||
processor::initialize();
|
||||
processor::enable_protectedMode();
|
||||
printf("Boot device: 0x%x\n", BIB->bootDeviceID);
|
||||
unsigned int part3 = BIB->bootDeviceID & 0xFF;
|
||||
unsigned int part2 = (BIB->bootDeviceID & 0xFF00) >> 8;
|
||||
unsigned int part1 = (BIB->bootDeviceID & 0xFF0000) >> 16;
|
||||
unsigned int drive = (BIB->bootDeviceID & 0xFF000000) >> 24;
|
||||
if (drive == 0x80 )
|
||||
printf("booted from disk!\n");
|
||||
if(drive == 0x00)
|
||||
printf("booted from floppy disk\n");
|
||||
|
||||
printf("Part1: %d, Part2: %d, Part3: %d\n", part1, part2 , part3);
|
||||
|
||||
|
||||
VirtualFileSystem::initialize();
|
||||
|
||||
// Try and open hello.txt file
|
||||
VirtualFileSystem::OpenFile("a:hello.txt");
|
||||
|
||||
|
||||
|
||||
// Try and open grub.cfg file
|
||||
VirtualFileSystem::OpenFile("a:boot/grub/grub.cfg");
|
||||
|
||||
|
||||
|
||||
#ifdef USERMODE_RELEASE
|
||||
// Lets jump into user mode
|
||||
|
Reference in New Issue
Block a user