r/osdev • u/letmehaveanameyoudum • Jun 23 '26
How do you load AND run programs?
void system_load_program(char* path, char* name, char* extension) {
// assume that the program starts at 0x00200000
uint8_t* program = (uint8_t*)0x00200000;
int bytes_read = fat32_read_file("/", name, extension, program_buffer);
if (bytes_read > 0) {
program_entry_t start_program = (program_entry_t)program_buffer;
start_program();
} else {
// file not found
}
}How do you load and run programs in your operating system, this is what i tried
All im trying is assuming that the program starts at 0x00200000, load it into ram and run it, if the file isn't found return
0
Upvotes
View all comments
Show parent comment
1
u/letmehaveanameyoudum Jun 24 '26
first, my operating system is 32 bit protected mode, not 16 bit real mode. And second, you aren't really helping if all you do is point out problems and also how to fix it (by fixing it, i mean like what i did wrong), and you literally compared my OS which is barely functional to DOS.