flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > Question/suggestion about API and the kernal

Author
Thread Post new topic Reply to topic
Wishing



Joined: 21 Feb 2004
Posts: 56
Location: NY
Wishing
Not sure who would know this besides Ville...
When a process creates a interupt 40.. does the
kernal do a linear search through a table to find out where to
jump to the kernal side API code?
Is there only one copy of the API code at all times and multiple "pages"
of it (to permit interupt multitasking)
Or does the kernal API get copied into seperate blocks to permit this?

Im asking these question because I had an idea tthat might speed up
kernal processing quite abit. Instead of searching a table (servetable: ?)
in the kernal.. couldnt we make every API in the kernal take up the same
amount of space (based on the biggest API).. and then make the interupt
call do a direct jump to a HASH based on the eax value?
(this might require some reordering of kernal API addresses/code)
(and it would definately enlarge the kernal size with blank areas)

Just an idea... hashes are nice and fast... linear searches are slow...
Wishing

_________________
446f6c7068696e
Post 22 Sep 2004, 07:28
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld
Hash tables are already done. Look at SYS32.INC, you'll find smth like:
Code:
...
table:
  dd eax_eq_00 ; define window
  dd eax_eq_01 ; put pixel
  ...

eax_eq_00:
  ; process window definition here

...
; int 0x40:
jmp dword[eax*4+table]
...    
Post 22 Sep 2004, 10:51
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
THat looks more like a jumptable than a hash table to me?
Also, if you wanted a "non-massive" table, order the entries and do a binary search.
Post 22 Sep 2004, 14:44
View user's profile Send private message Visit poster's website Reply with quote
Mike Hibbett



Joined: 02 Sep 2003
Posts: 88
Location: UK
Mike Hibbett
The system table will never be massive, so a table lookup is a sensible choice ( 4 bytes per entry, 60 odd entries ).

Mike.
Post 22 Sep 2004, 15:29
View user's profile Send private message AIM Address Reply with quote
Wishing



Joined: 21 Feb 2004
Posts: 56
Location: NY
Wishing
Ahh yes... that is a hash.

to f0dder:
A binary search would be slower than a hash. In a hash there is no need to search at all.. you automatically know where to go by mathematicle means. Thats what the jmp dword[eax*4+table] is.
The table just makes it so you dont ahve to do my silly version fo block-ifying the API... odd i didnt think of that Razz

Thanks for clearing this up for me. Im glad the menuet kernal is as sophistimacated as i had hoped ^_^
Now if we could only load and unload hardware drives without recompiles Wink
Post 22 Sep 2004, 17:00
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.