Simple Operating System
loader-asm.c File Reference

Programs loader ! More...

#include "lib.asm"
Include dependency graph for loader-asm.c:

Go to the source code of this file.

Functions

int load (beginSector, track, parameter, size, segment)
 load program to segment and executes it More...
 

Detailed Description

Programs loader !

as kernel is in 32 bits functions must be called with 32bit return address - call DWORD. can also push 0; call func

Definition in file loader-asm.c.

Function Documentation

◆ load()

int load ( beginSector  ,
track  ,
parameter  ,
size  ,
segment   
)

load program to segment and executes it

Parameters
beginSector[ebp+8]
track[ebp+12]
parameter[ebp+16]
size[ebp+20]
segment[ebp+24]
Returns
int value returned from program or -ENOEXEC (-8) when error
Todo:

add sys_exec(int filename)

add sys_exit(int code) as subprogram

add check if in code is 8E = change of sreg or EA = jmpf and then don't execute

change call far on jmp far and iret to push 0; push callerAddress; push DWORD[0x8]; iret

add pages int 10h AH=5

split it to loading and executing

add to programsMap program's properties

Definition at line 27 of file loader-asm.c.