Tired of doing the same gdt things? Here's your answer!
Tired of doing the same gdt things? Here's your answer!
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..
the code snipplet and readme file is attached..
- Attachments
-
- gdt_stuff.zip
- Code snipplet and readme
- (4.51 KiB) Downloaded 76 times
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.
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.
http://www.osdev.org/phpBB2/viewtopic.php?t=12528hckr83 wrote:lol, I didn't do call gates as I have no idea how they work...
I think that clears up the Call Gates Mechanism...
I think, I have problems with Bochs. The biggest one: Bochs hates me!
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!INF1n1t wrote:http://www.osdev.org/phpBB2/viewtopic.php?t=12528hckr83 wrote:lol, I didn't do call gates as I have no idea how they work...
I think that clears up the Call Gates Mechanism...
I really will need to re-read that chapter of the AMD manual someday...
JJ
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.
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.