How to implement system services?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
SolidSnake
Posts: 10
Joined: Thu Jun 28, 2007 6:36 am

How to implement system services?

Post by SolidSnake »

I have followed simple tutorial in creating OS..

I learned how to implement GDT dan IDT, then switch to protected mode.. But I still don't fully understand how IRQs work and implementation of TSS..

I want to know how can I create system services to be called by applications in the OS. In the tutorial, there are a function to write to display buffer.. Is that what we call system services? If so, then I must write call-gate so application in PL 3 can call the function in PL 0, right? But how applications know to locate the call-gate? Are all system services located in one "kernel.bin" file too?

Can I just use the IDT to provide call to system services? Why Windows don't do like that such as in DOS before?

Btw, can I still use BIOS interrupt to communicate with motherboard? I mean by preserving and adjusting the address in real-mode interrupt vector table to p-mode IDT? Is it useful or there are new way?

Sorry for too many questions, I'm just curious about a lot of thing and don't know how to learn them by myself.
Pyrofan1
Member
Member
Posts: 234
Joined: Sun Apr 29, 2007 1:13 am

Post by Pyrofan1 »

Can I just use the IDT to provide call to system services?
yes you can, just create an interrupt that calls a system function that checks the value of eax and then does something.
But I still don't fully understand how IRQs work
IRQs are just interrupts made by hardware
and implementation of TSS..
in TSS you have a segment in the GDT that points to the tss and then you load the TSS with

Code: Select all

ltr $tss_selector
Are all system services located in one "kernel.bin" file too?
if you have a monolithic kernel
Btw, can I still use BIOS interrupt to communicate with motherboard?
not unless you're in VM86 or real mode
I'm just curious about a lot of thing and don't know how to learn them by myself.
the wiki and the intel manuals are great resources
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

Btw, can I still use BIOS interrupt to communicate with motherboard?
If you make addressing identical in real mode and protected mode, by setting the base of the code and data descriptors to DS * 16, then you can write a simple function to go to and from realmode to do BIOS int's or you can use a "BIOS32".
Post Reply