Question about Drivers...

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
Gioyik
Posts: 3
Joined: Thu Jan 20, 2011 9:15 am

Question about Drivers...

Post 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...
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: Question about Drivers...

Post 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.
Gioyik
Posts: 3
Joined: Thu Jan 20, 2011 9:15 am

Re: Question about Drivers...

Post by Gioyik »

Thanks For your Answer... :wink:
Post Reply