3#include "../../lib/base/stdio.h"
4#include "../../lib/base/heap.h"
6#include "../kernel/interruption_tables.h"
9u_dword modules_placement = 0x30000;
12extern boolean read_disk(
void* address,
boolean slave_drive, u_word length, u_word offset,
void* buffer);
14void init_module_loading_driver() {
15 silence_interrupt(46);
18void* place_module(u_dword
size) {
19 u_dword tmp = modules_placement;
20 modules_placement +=
size;
24void* load_module(u_word offset, u_word length) {
26 if (length % 2 != 0) ;
27 if (offset % 2 != 0) ;
28 void* place =
ralloc(length);
29 info(
"Loading module at offset %d, length %d to memory address: %h\n", offset, length, place)
30 boolean res = read_disk((
void*) (offset / 512),
false, length, offset, (u_word*) place);
31 info(
"Reading result: %d\n", res)
void * ralloc(u_dword size)
u_dword size(void *structure)