#Serpyntyne: micropython but for real computers
1 messages ยท Page 2 of 1
I'm an idiot lol I forgot to send an EOI
Boom it works
Also this is the 1001th message ๐ why is my crap OS the most active thread in no-ai lol
Alright time to work on the scheduler today
Global variables are not liking me today
Even though I initialize it it's being set to null
I think this is some C noobism
So I'm not getting any panic messages and it appears it's because the kprintf is spunlocked when it tries to panic but because there's no way for it to unlock it hangs
Yep I force-unlock the terminal and it's fine
Except it page faults still ofc
So for the chat stalkers the scheduler I'm working on goes through the linked list of "processes" (which are just dummies right now) and finds the one of the highest overall priority
It calls an absolutely diabolical inline function to find the total priority which is kinda jank but it shouldn't page fault
I'm clearly passing a null pointer somewhere but it's unclear where so far
Actually it does I just had an underflow at first apparently lol
Why micropython
It's a bit of a joke. I'm not actually porting micropython to bare metal, I'm making an OS that can (should, someday) run python in kernel-space or in user-space on the kernel
LOL ur username change 
Yeah, I hate Python with every fibre of my being
So don't trust my opinion on Python lol
I actually don't like it a whole lot either ๐
It's just the other language I know well
And I thought this would be a fun exercise
I'm SO FRICKING CLOSE to getting task switching done
Either it just hangs or it launches into a task, either way no interrupts
After the switch I mean
restore the ints after popping the regs
I just looked and in fact I am not setting the interrupt enable flag 
And I set it and it just hangs 
hangs where?
Boutta look, gotta do an objdump
Haven't set that up yet lol
I've gotten this far with just printf debugging and objdump
Dang I didn't know that
add the -s flag to qemu
and -S to make qemu wait for the debugger
then run gdb like: gdb <kernel elf>
Alr
And it's hanging in one of the test procedures
f
On a sub
https://qemu-project.gitlab.io/qemu/system/gdb.html
or just refer to the documentation too lol
Doesn't even make sense to hang on a sub
Kay
So I've figured out what's happening I think (no help to you gdb)
It's hanging on random instructions
In the test processes
So I think it's actually the first interrupt after the processes hanging, probably because the task switch means that it never went back to unlock the scheduler
I get two task switches now before hang, it's an upgrade
It appears that it does not like returning the task to the interrupt handler after its first preemption
Removed an unnecessary STI and it doesn't hang but it also doesn't preempt lol
Time to simplify priority nonsense
It preempts once and as hard as the scheduler tries it doesn't preempt again 
I suspect my task switching assembly is borked
how is his going? cool project !!
Taking a pause rn bc the scheduler was starting to fry me
I'm working on a fantasy computer rn
ahhhhh
