Implementing a Multitasking System

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
User avatar
t0xic
Member
Member
Posts: 216
Joined: Sat May 05, 2007 3:16 pm
Location: VA
Contact:

Implementing a Multitasking System

Post by t0xic »

Hey everyone! It's been awhile, but I decided to hop back into OS dev'ing for a little while. I left off after implementing paging/memory management into my kernel, and I was wondering if any of you have implemented a working software or hardware multitasking system, as I would like that to be the next goal for my little hobby.

I have worked on a hardware context switching system, but I cannot get it to work... back to google for now...

I am aware of the pros and cons of each system, and I would like to use software multitasking, but I can't find any good resources out on the web. Do any of you have any reliable resources/code that I could look at?

Thanks,
Michael
User avatar
ucosty
Member
Member
Posts: 271
Joined: Tue Aug 08, 2006 7:43 am
Location: Sydney, Australia

Post by ucosty »

Forget hardware multitasking. It's inflexible and only works on x86 chips in 32bit mode.

There is lots of info on this site and osdever.net. If you have any specific questions I can answer them as I have implemented a ring0/3 software task switcher.
The cake is a lie | rackbits.com
User avatar
lukem95
Member
Member
Posts: 536
Joined: Fri Aug 03, 2007 6:03 am
Location: Cambridge, UK

Post by lukem95 »

Many people have done on this forum, i'd take a look at www.jamesmolloy.co.uk, as his tutorials are excellent and cover loading modules.. which is the first step to programs.

you then need ELF/COFF(-PE) (depending on format)relocation to successfully run the app.

i can't help with multi-tasking im afraid, as i have no idea myself, apart from that it involved using the GDT to create a TSS for each task.
~ Lukem95 [ Cake ]
Release: 0.08b
Image
User avatar
ucosty
Member
Member
Posts: 271
Joined: Tue Aug 08, 2006 7:43 am
Location: Sydney, Australia

Post by ucosty »

lukem_95 wrote:i can't help with multi-tasking im afraid, as i have no idea myself, apart from that it involved using the GDT to create a TSS for each task.
Thats only for hardware task switching. Software switching only requires one TSS per CPU (to store the Ring 0 ESP).
The cake is a lie | rackbits.com
User avatar
t0xic
Member
Member
Posts: 216
Joined: Sat May 05, 2007 3:16 pm
Location: VA
Contact:

Post by t0xic »

Thanks for reminding me about osdever... Reading one of the tut's now :D

Thanks,

Michael
Post Reply