Page 1 of 1

Question about Drivers...

Posted: Sat Jan 22, 2011 8:09 pm
by Gioyik
Hello at all the users from this Forum...

I am new on this Forum and I have a Question...

I have Drivers Write on C and ASM.... So How I Can integrate this Drivers at my Kernel?

My Kernel or SO is Write totaly on C...

Well I search a guide that help me with my Question...

I have a Guide or any user to explain how integrate the Drivers... What are the requirements for integrate this Drivers at my Kernel or SO?

What are the files for the good operation the Kernel or SO?

Well I acept all the suggestions..

Thank you Very Much...

Re: Question about Drivers...

Posted: Sun Jan 23, 2011 4:38 am
by Tosi
Gioyik wrote:Hello at all the users from this Forum...

I am new on this Forum and I have a Question...

I have Drivers Write on C and ASM.... So How I Can integrate this Drivers at my Kernel?
If you're aiming for a monolithic kernel, then the drivers can be practically built-in to the kernel, and only activated if the hardware is detected at boot time.
With a microkernel, you need some way to read files from disk, so I would put at least that in an initramfs or a module initially loaded by the bootloader.
Then it's just a process of maybe loading a few modules to detect hardware, and loading all the other drivers from there.
A hybrid kernel would be somewhere in-between, with the most common or portable drivers being built-in to the kernel and less common or ones not needed until later being loaded separately.
Gioyik wrote: I have a Guide or any user to explain how integrate the Drivers... What are the requirements for integrate this Drivers at my Kernel or SO?
Not much. You can write a basic VGA text mode driver by just being in protected mode with a valid GDT and stack.
If you want loadable drivers with a standard interface, I would recommend having this much at least:
- Virtual memory management, with paging
- Multitasking and some IPC
- Exception handlers
- System calls: some kind of read(), open(), fork/CreateProcess, sbrk/mmap/GetMoreMemory at least
- Make sure you have remapped IRQs with the PIC or APIC.
- Maybe PCI or PnP support
- Filesystem with the ability to read/write files. This will require a floppy/hard drive/CD/etc driver as well as one for whatever filesystem you're using.

This isn't all inclusive, and I'm hardly an expert on the subject, but it's what I have been considering when thinking about drivers.

Re: Question about Drivers...

Posted: Sun Jan 23, 2011 9:17 pm
by Gioyik
Thanks For your Answer... :wink: