flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Priority multitasking problems

Author
Thread Post new topic Reply to topic
Artlav



Joined: 23 Dec 2004
Posts: 188
Location: Moscow, Russia
Artlav 21 Aug 2005, 17:20
Short description:
Multitasking engine is on the timer interrupt (where else?).
Tasks is stored in one-way dynamic list (Every task have a link to the next one).
Every task have a pri in 0-255
The multitasking engine of my kernel must support priorities.
Ive implemented it this way - When task is changed, new one's pri is put into a variable. On every step this value is decreased and compared to 0, jbe switchtask.

The problems is:
1. What value to put into the timer frequency? Should it be constant, or change with task amount? How?
2. When task count is ~100, if all tasks have the same pri, then system runs much smoother, than if at lease one of them have more. Why?
3. Reducing timer frequency (port 40h) to about 400h or raising the task count to ~200 results in "crazy hangup" with random exeptions. What kind of bug could this be?
4. Any better implementations?
Post 21 Aug 2005, 17:20
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 21 Aug 2005, 18:50
Last years winner of the 512b compo, may help as its well commented.
Its called "nanoos2.zip" and you can get at the bottom of this link:
http://board.flatassembler.net/topic.php?t=2164&start=100
Post 21 Aug 2005, 18:50
View user's profile Send private message Reply with quote
Artlav



Joined: 23 Dec 2004
Posts: 188
Location: Moscow, Russia
Artlav 22 Aug 2005, 04:57
Checked this one out. Rather interesting and useless... Doesn't support priorties... Doesn't set up timer... Got no bugs...

Anyway, thank you for reply.
Anyone else?
Post 22 Aug 2005, 04:57
View user's profile Send private message Visit poster's website 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.