About creating a new task!

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
RodrigoFagner

About creating a new task!

Post by RodrigoFagner »

Please anyone could tell me how work in protected mode Example.

on the prompt of command the user ask to execute a new program how do
I do that internally on the kernel ? alocate a new descriptor on the GDT a new TSS in Protected Mode? I need to swich back and then reinitialize the GDT TSS ??? I´m little confuse! Just for help nothing complete! please!?

many thanks ! RodrigoFagner :-)
TheUbu

RE:About creating a new task!

Post by TheUbu »

Rodrigo,

Ok you can use multiple TSS but then you are limited to the number of free descriptors in your GDT so if I was you I would use a single TSS and reset the busy bit every time you reinitialize it. Now if you want to start task switch with TSS I would set up the time and some simple scheduler that loops through a linked list each task would have its own TSS image. What you can do from there is update the GDT entry to point at the memory address of that tasks TSS then far jump to the TSS. As far as know the structure of the TSS the intel programers doc 3 or www.google.com will return tons of resources a scheduler well thats on you its not hard to loop through a linked list. Remember now once you start switching between tasks you have to make sure things are re-entrant safe other wise you will have re-entrant issues causing all kinds of unexplained errors.

I don't want to come down on you but you seem like you have hardly any of the needed systems in place to even being playing with task switching. Do you have any of these following items implimented...

IDT,Time,File System,VM,IO Control,Basic Device Drivers?


-Christopher
RodrigoFagner

RE:About creating a new task!

Post by RodrigoFagner »

Just a little bit I´m trying to rewrite a PMTUTS from ALEIX in pascal I´m right now on the 04... but you know! I´m learning, right now the things look´s like so confuse! easy to understand on the paper but in fact ! owww ! :-)

many thanks!!!

RodrigoFagner
TheUbu

RE:About creating a new task!

Post by TheUbu »

Rodrigo,

TSS is quite simple as long as you understand the structure. If you want to see task switching in action start SIMPLE initialize your PIT to say 100Hz and make your timer interrupt do some basic scheduling make two tasks that are an infinite loop say one like void taskA() { while (1) kprint("."); } and the other like taskB() { while (1) kprint("+"); } then set up two TSS in memory not in your GDT with TSS1.EIP = taskA; TSS2.EIP = taskB; Then in your scheduler just do something like i++ if i%1 { make your GDT-TSS entry TSS1 } else { make your GDT-TSS entry TSS2 } ljmp GDT-TSS and you should be seeing ....++++....++++ on your screen or something very similar.


-Christopher
RodrigoFagner

RE:About creating a new task!

Post by RodrigoFagner »

Many thank´s ! and what about the ID partition table it was the you want? otherwise tell me I have download many zips tar´s bzips from the internet tutorials lists sources, etc!

:-)

-Christopher

Rodrigo Fagner
TheUbu

RE:About creating a new task!

Post by TheUbu »

Well the list you posted you didn't add the two IDs I soaked up to it.  My intention was to mostly let everyone know that I'm going to use them unless they are using it or know if it was used... So I think the Ubix project is safe to take its claim of them.....

Well good luck with your task switching hope the last post was really helpful its kind of the most basic way to get you to switching tasks and everything else you should find in your Intel manuals..


-Christopher
RodrigoFagner

RE:About creating a new task!

Post by RodrigoFagner »

ok so! sorry! I forgot to tell you, I don´t speak much english, If I said anything you don´t like! just sorry me ! really sorry!

:-)

thank you very much

-Christopher

RodrigoFagner
Post Reply