flat assembler
Message board for the users of flat assembler.

Index > OS Construction > OS Design Multitask

Author
Thread Post new topic Reply to topic
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 13 Dec 2007, 01:06
This is my first OS... and I have a basic multi-threading environment...
Keep in mind this is a GUI... and again my first OS... Sorry, if this is a stupid?

example:
Task_0:
load-disk_driver into mem switch next task
Task_1:
load-mouse_interface into mem switch next task
Task_2:
load-start_menu/task_bar loads gui and uses int ?? to enable mouse/show etc..
Task_3:
load task manager... ck tasks for exit,idle, etc..
etc...
This is just an example of one interface I was trying..for testing..
I would like any input/comments on design or possible issues

and a question about rendering the screen.. buffer to screen..
The time,desktop,background..text use an offscreen buffer...

It seems kind of weird calling the render_screen from an int ??
example:
int??_draw_window:
get_pos_X,Y...
get_win_size...
draw_window..
render_to_screen?
iret

Thanks in advance for any help/sugestions..
Post 13 Dec 2007, 01:06
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 13 Dec 2007, 01:24
screen print can be made by only one code, the global gui.
i explain:
all graphics are from graphix functions, with correct parameters.
each task can have a single render stack, this stack will contain all the graphix request for render.

the task doesn't display anything, just say to the global gui what to display.
ones the task are threaded, return to main , the main will make the final render.
if a task have the time to fully set it's render stack, a flag is set and the main gui can render the task.

a task can be interrupted everywhere, because it's multitasking.

example:
task0: load disk in mem
task2: mouse int in mem
task3: program with render request
task4: another program
...

timer will switch the tasks at various intervals.
the task manager set the period for each task, depending on task content, if a task need only 100 cycles to loop, no need to execute it more.
if a task use a lot of cycles > 100 000 000, it will be switched before it reloop and returned during next switch.

all these suggestions are in fact the idea i want to apply for MY OS: SEA
i am thinking about this problem since a long time, i have studed all possibilities, and this one appear to be one of the best, but one of the more complex to code.
Post 13 Dec 2007, 01:24
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 13 Dec 2007, 02:58
Quote:
ones the task are threaded, return to main , the main will make the final render.

what do you call "main" here?

Quote:
if a task have the time to fully set it's render stack, a flag is set and the main gui can render the task.

what is "main gui"? same thing you call "renderer" or "global gui"?

Using some solid naming for components would render your text much more readable. In current presentation, it is very unclear what is what.

dosin: idea as explained by edfed is right. There should be only one component that will do actual drawing (writing to video buffer), and other components should just call functions provided by this component. In windows this component is GDI (alternatively DirectDraw), in linux it is X server. Caching these requests, not immediate processing, is a good idea.
Post 13 Dec 2007, 02:58
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 13 Dec 2007, 03:15
renderer == global gui == main

sorry, like i'm not informatician, i don't know axactlly what i say.
in fact, i only know asm instruction set. the rest is like a shadow for me.

sorry...

the main is simply the part of the kernel that is executed before each task switch session, a task switch sessio for me is one task switch cycle/loop, you see what i mean?

for task that haven't the time to set all it's request, we need two render stack per task. one active and one pending...
the active is the one who is ready to display, the pending is the stack currently defined.

because without this, some long time task will render with missing drawing.
i'm working on a task manager like this, i already have a good render stack manager. application exemple is in my bootpm.zip.
Post 13 Dec 2007, 03:15
View user's profile Send private message Visit poster's website Reply with quote
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 13 Dec 2007, 03:38
Quote:
There should be only one component that will do actual drawing (writing to video buffer), and other components should just call functions provided by this component


Well thats what my render does.. and thats why I said it was kind of weird calling it in all the int ??s that use it... Very Happy

I was thinking of adding the render() function into the task switch... somehow.. the pixel and all drawling functions draw to the buffer.. then the render puts the buffer to the screen..

Is there anywere on the net I can read about that type of multitasking edfed.. ?
Post 13 Dec 2007, 03:38
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 13 Dec 2007, 04:02
only one place, my brain..
seriously, as i'm a beginner, i don't know what i speak about, all that i say, i extact it from my logic mind.
in the asm-life, there are some things you shall do youself, like re-invent the weel everydays.
i'll give you more precision about it when i'll make it because i don't know anyplace to find any theory for this, so i'll seek the solution in my brain, i always make it.
Post 13 Dec 2007, 04:02
View user's profile Send private message Visit poster's website Reply with quote
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 13 Dec 2007, 05:11
I have been looking over linux.. for ideas... Though I'll prob use something sim at first... I am just in the early stages of this.. and wanted to here what people had to say.. about rendering the screen and multitasking in general...
pros/cons..

just looking for ideas...

Though, I usually do things the hardway first...

Thanks, again for any input!
Post 13 Dec 2007, 05:11
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 21 Dec 2007, 21:07
hello dosin!
have you got a working task switch now?
if yes, do you use the IRQ0?
, do you save states in hardware TSS?
, do you point to GDT or LDT for tasks?

hem, too much questions i think...
Post 21 Dec 2007, 21:07
View user's profile Send private message Visit poster's website Reply with quote
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 21 Dec 2007, 22:28
Quote:
if yes, do you use the IRQ0?


Yes, the iret/retf will fire to my irq0 / int 32


Quote:
do you save states in hardware TSS


not yet-I need to add more irqs first..
I have irq0,irq1,irq6-in progress,
I want to complete all the irqs before I add

Quote:
do you point to GDT or LDT for tasks?


I have been using the GDT so far...
Post 21 Dec 2007, 22:28
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 22 Dec 2007, 16:52
dosin: Are targetting 32bit or 64bit OS? There's no hardware task switch in long mode...

regards,
Mac2004
Post 22 Dec 2007, 16:52
View user's profile Send private message Reply with quote
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 22 Dec 2007, 17:30
32 bit
Post 22 Dec 2007, 17:30
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.