Stack Initialization
Posted: Thu Jan 15, 2004 12:00 am
I'm currently working on linking ELF object files in my OS,
and i am having trouble setting the stack up properly im loading the registers as follows
mov ax,0x28 //Programs Data Segment
mov ss,ax
mov esp,0x3c0000 //Where I want the stack
and i then call the relocated program which then crashes, the machine resets when it encounters the return(0) instruction if I leave the stack where it already resides the program will run, but I need the stack for the program so i can use c++ commands like <for> and any others that compile using the <lea> command
any help on setting up the stack properly will be appriciated
pkd 15jan2004
and i am having trouble setting the stack up properly im loading the registers as follows
mov ax,0x28 //Programs Data Segment
mov ss,ax
mov esp,0x3c0000 //Where I want the stack
and i then call the relocated program which then crashes, the machine resets when it encounters the return(0) instruction if I leave the stack where it already resides the program will run, but I need the stack for the program so i can use c++ commands like <for> and any others that compile using the <lea> command
any help on setting up the stack properly will be appriciated
pkd 15jan2004