the saga continues.... More Questions (yay!)

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.
Post Reply
Matt

the saga continues.... More Questions (yay!)

Post by Matt »

i'm sure everybody's getting tired of my questions so I'll keep it short.
In your bootloader, instead of doing a jmp to the kernel that it loads, instead, would it work if I changed the cs and eip registers to point to the program? (or would that just screw up the code that is trying to load the kernel (like if you changed the offset before the segment, it would'nt execute the code that changes the segment)
And if you are wondering why I want to do this, its because so I can get a hang of how I would set up a multitaskign system...
another question: whats the deal with the CR0 (or some other number) bit that you are suppose to do something with in multitasking. I've read somewhere that you have to change some CR(what number?) bit in your taskswitcher, but I've never found out what that is (or what it does).

[glow=red,2,300]Thanks (once again :D)[/glow]
Tim

Re:the saga continues.... More Questions (yay!)

Post by Tim »

You could directly update the CS:EIP registers using a special variant of the MOV instruction... called JMP :). That is, JMP seg:off is the only direct way of updating CS:EIP. An alternative is IRET, which is how you update CS:EIP in a multitasking system.

If you're using software switching the processor doesn't need to know about it. The only processor stuff you use then is stack switching (MOV ESP, new_stack) and the TSS (CPU loads the kernel SS:ESP from the TSS when an interrupt occurs).
Matt

Re:the saga continues.... More Questions (yay!)

Post by Matt »

Lol, Ok. I might almost be ready to make a task switcher without copying somebody elses source code ;)
Post Reply