freeload.exe - FreeWorld OS Loader
Overview
freeload.exe is the FreeWorld OS loader responsible for loading the core OS kernel and essential boot-start device drivers into memory. It acts as the second-stage bootloader, executed after BOOTMGR.
Main Function
int main(int argc, char** argv) {
printf("FreeWorld OS Loader v0.1\n");
printf("Loading kernel and drivers...\n");
// Load BCD
bcd_entry_t entry;
if (bcd_load("BCD") == 0) {
if (bcd_get_default_entry(&entry) == 0) {
printf("Boot entry: %s\n", entry.name);
printf("Kernel: %s\n", entry.kernel);
printf("Loader: %s\n", entry.loader);
// Load kernel into memory
// This will be implemented with actual memory loading
printf("Kernel loaded successfully.\n");
}
}
return 0;
}
Functionality
Boot Process
- Display loader version information
- Load Boot Configuration Data (BCD)
- Retrieve default boot entry
- Display boot entry information
- Load kernel into memory (to be implemented)
- Load essential device drivers (to be implemented)
- Transfer control to kernel
Dependencies
- BCD Library: Uses BCD.h for boot configuration
- Standard C Library: Uses stdio.h, stdlib.h, string.h
Variables
| Variable | Type | Scope | Description |
|---|---|---|---|
entry |
bcd_entry_t | local (main) | Boot entry structure from BCD |
argc |
int | parameter | Command-line argument count |
argv |
char** | parameter | Command-line arguments array |
Future Implementation
The following features are planned for future implementation:
- Kernel Loading: Actual memory loading of kernel binary
- Driver Loading: Loading of essential boot-start drivers
- Memory Management: Setting up memory maps and page tables
- Protected Mode: Transition from real mode to protected mode
- Kernel Transfer: Proper jump to kernel entry point
Build Instructions
cd boot/freeload make
This compiles freeload.c and links it with the BCD library to produce freeload.exe.
Integration Points
- BOOTMGR: Called by boot manager after initial boot
- BCD: Reads boot configuration from BCD file
- fwoskrnl.exe: Loads and transfers control to kernel
- hal.dll: May load HAL before kernel initialization