Page 1 of 1
Tired of doing the same gdt things? Here's your answer!
Posted: Tue Dec 26, 2006 7:45 pm
by earlz
Well I did this for myself but because it is so portable I thought a few people may want it so...
the code snipplet and readme file is attached..
Posted: Tue Dec 26, 2006 7:58 pm
by Ready4Dis
Looked through it, have no clue what I would use it for. I mean, once my gdt is setup, I really don't need to play with it, that's what paging is for, unless i'm missing something (very possible, i'm a bit tired atm). Just seems like a ton of functions that will bloat my already bloating kernel
. They would make it a bit simpler on a beginner I suppose, being able to set the bits in a nice logical manner, and it's probably only an extra kb or so, but, for me, I am trying to save as much space as possible for other things.
Posted: Tue Dec 26, 2006 8:02 pm
by earlz
meh... guess I was thinking too much of how my kernel multitasking is planned...planning on doing sometghing like this for idt and tss though..maybe a bit more useful to "everyone"
Posted: Wed Dec 27, 2006 4:48 am
by Ready4Dis
Yeah, I can see how it could be useful to people, it simplifies a lot of things that look really ugly when you do them directly multiple times. And if you change your GDT often (call gates?), it would definitely be useful. I have similar code setup for my IDT, except it's all in asm, lol. I have re-written a lot of my kernel in C now, trying to make it more easily compileable on multiple platforms.
Posted: Wed Dec 27, 2006 11:51 am
by earlz
lol, I didn't do call gates as I have no idea how they work...
Posted: Wed Dec 27, 2006 4:26 pm
by INF1n1t
hckr83 wrote:lol, I didn't do call gates as I have no idea how they work...
http://www.osdev.org/phpBB2/viewtopic.php?t=12528
I think that clears up the Call Gates Mechanism...
Posted: Wed Dec 27, 2006 6:26 pm
by JJeronimo
Call Gates, Interrupt Gates, Control transfers between non-conforming code segments, along with stack switching, TSSs, and things alike are such___a___great___and___very___complex___confusion that I have no idea if I'll ever be mentally capable of understanding it!
I really will need to re-read that chapter of the AMD manual someday...
JJ
Posted: Sun Dec 31, 2006 12:00 pm
by Edward
I'm sorry to tell you but intel beat you to some of your functions...
A few similar ones are implemented in microcode on the chip:
http://pdos.csail.mit.edu/6.828/2006/re ... 6/VERR.htm
That one verrifyes a segment is readable or writeable.
Posted: Sun Dec 31, 2006 12:31 pm
by earlz
yea, I saw these instructions after I wrote all this..
maybe convert some of them to use asm for faster...
Posted: Sun Dec 31, 2006 12:37 pm
by Edward
Somtimes descreete instructions are faster than the single opcodes that are implemented on the chips.
Posted: Sun Dec 31, 2006 12:39 pm
by earlz
Somtimes descreete instructions are faster than the single opcodes that are implemented on the chips.
..would've never thought that