Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Hi! I've restarted development of my OS (with the bare minimum of features) and I kind of need help again with task switching. It crashes randomly unless I push the task switching asm code 400kb using a resb (Probably some invalid address its using)
NanoShell --- A 32-bit operating system whose GUI takes inspiration from Windows 9x and early UNIX desktop managers. Boron --- A portable SMP operating system taking inspiration from the design of the Windows NT kernel.
Looked into the issue a bit more but I still can't find the error. I'm kind of lost right now
Hey! I'm developing two operating systems:
NanoShell --- A 32-bit operating system whose GUI takes inspiration from Windows 9x and early UNIX desktop managers. Boron --- A portable SMP operating system taking inspiration from the design of the Windows NT kernel.
Ok, I tracked down the issue. You see, in task.c I have a variable named CPUSaveState* g_saveStateToRestore = NULL; that I use in RestoreKernelTask. Using a debugging tool I have I can find that the address is .bss:29F978. Then I make reference of it in ktask.asm (I use NASM to compile asm files) and the code looks something like this:
extern g_saveStateToRestore
OnStartedNewTask:
OnStartedNewKernelTask:
;cli
; restore the registers now
mov esp, [g_saveStateToRestore]
The problem is that the value used by the asm's g_saveStateToRestore does NOT have the same address as the one inside the C file. Instead it's been moved 0x100 bytes forward to .bss:29FA78. It's really strange.
NanoShell --- A 32-bit operating system whose GUI takes inspiration from Windows 9x and early UNIX desktop managers. Boron --- A portable SMP operating system taking inspiration from the design of the Windows NT kernel.
Guess the decompiler was the issue, haha. Anyways I tracked it down to my memory allocator of all things starting allocation too early (at 0x200000, but the kernel bss section went till 0x2A0000).
Hey! I'm developing two operating systems:
NanoShell --- A 32-bit operating system whose GUI takes inspiration from Windows 9x and early UNIX desktop managers. Boron --- A portable SMP operating system taking inspiration from the design of the Windows NT kernel.