<bslsk05>
SlugOS/SlugOS - A minimal OS (0 forks/0 stargazers/CC0-1.0)
edr has quit [Quit: Leaving]
<zid>
ThatOSDeveloper: Sounds like you read the stack wrong then? did you push 1 / push 2 / push 3 etc at the start of an otherwise generic handler or osmething then try to pop it off?
<heat>
gotta pray and fast for intel
<ThatOSDeveloper>
oh crap I never pushed it LOL
<ThatOSDeveloper>
wait no I did
<zid>
where am I looking
<zid>
ah, init
MiningMarsh has quit [Ping timeout: 252 seconds]
<ThatOSDeveloper>
inside of src/init/interrupt and inside of isr.s and exception.c
<heat>
well for one there's a big problem
<ThatOSDeveloper>
what?
<heat>
in that you never pop the state back out
<ThatOSDeveloper>
oops
<zid>
biggest problem I noticed is that you have your * on the wrong side of this char
<ThatOSDeveloper>
kinda new to assembly lol
<zid>
disgraceful behaviour
<ThatOSDeveloper>
and eh with C, I mean I am mid with it, only known it for a few years
<heat>
isr_no_err_stub never pushes anything either
<heat>
childlikempress, BASED paulmck memory models i must add
<nikolar>
helpful as always zid :P
<ThatOSDeveloper>
oh yeah, I guess I am using cdecl?
<kof673>
* united states federal territory, they don't claim the land per se...federal territory is defined as outside any of the geographical states :D
<zid>
for example, the only one I ever remember off the top of my head, rdi = first parameter, rsi = second parameter, rdx = third parameter, ..., stack aligned to 16
<zid>
okay so cdecl says your args are on the stack
<ThatOSDeveloper>
oh, now I think I know what you mean
<zid>
you've pushed like 12 args, then retrieved 1 arg
<zid>
a pointer
<ThatOSDeveloper>
so do I just need to push like ebp (the stack frame)
<nikolar>
zid: pretty sure that's sysv
<nikolar>
rdi, rsi, rdx, rcx
<ThatOSDeveloper>
or is ebp the stack pointer?
<nikolar>
stack
<heat>
no, push esp
<ThatOSDeveloper>
oh esp okay
<heat>
also, your order is completely fucked
<nikolar>
esp - stack pointer
<nikolar>
ebp - base pointer
<zid>
you either want to do void exception(int arg1, int arg2, int arg3, int arg4, ...) or actually push esp first, so that your first thing on the stack is infact, a pointer to all that other crap :P
<zid>
I recommend the latter
<ThatOSDeveloper>
so I would need to do push %esp?
<zid>
s/first/last
<heat>
yes
<ThatOSDeveloper>
okay then I push all the other stuff?
<zid>
push esp just copies the current (which is the 'end') value of the stack pointer, to the stack, making it the first argument to your function call, and at the 'end' of the stack, is all the other crap you pushed to it
<heat>
no!
<zid>
push esp last, it needs to be the first argument to your function, and it needs to have the address of 'all the other crap'
<nikolar>
no! = NaN
<heat>
nikolar, js?
<ThatOSDeveloper>
right because assembly does it backwards compared to C right!
<heat>
ThatOSDeveloper, i think you dont understand the stack
<zid>
if you pushed it first, its value would be the saved eip of the assembly routine or whatever
<heat>
you really need to
<nikolar>
heat: just in general
<nikolar>
no is indeed not a number
<nikolar>
neither is no!
<ThatOSDeveloper>
listen man I barely understand C let alone assembly, I am impressed I even got this far on my own
<heat>
ok, then understand the stack
<zid>
You might wanna look at godbolt more, in future