GRUB modules as 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
KrotovOSdev
Member
Member
Posts: 40
Joined: Sat Aug 12, 2023 1:48 am
Location: Nizhny Novgorod, Russia

GRUB modules as drivers

Post by KrotovOSdev »

I am starting with my first device driver and I'm trying to understand how to load it. Can I use GRUB "insmod" command or something like that for this?
And I also read Device Management article and it says that I can not to write my own drivers but write only an interface for them and use already existing drivers. Am I right?

Thanks for your reply.
Octocontrabass
Member
Member
Posts: 5218
Joined: Mon Mar 25, 2013 7:01 pm

Re: GRUB modules as drivers

Post by Octocontrabass »

KrotovOSdev wrote:I am starting with my first device driver and I'm trying to understand how to load it. Can I use GRUB "insmod" command or something like that for this?
GRUB's "insmod" command loads GRUB drivers for GRUB. If you want GRUB to load drivers (or any other files) for your OS, use the "module" command. From your OS, you can access those files through the Multiboot information structure.
KrotovOSdev wrote:And I also read Device Management article and it says that I can not to write my own drivers but write only an interface for them and use already existing drivers. Am I right?
Yes. Which interface do you plan to use?
KrotovOSdev
Member
Member
Posts: 40
Joined: Sat Aug 12, 2023 1:48 am
Location: Nizhny Novgorod, Russia

Re: GRUB modules as drivers

Post by KrotovOSdev »

Octocontrabass wrote:
KrotovOSdev wrote:I am starting with my first device driver and I'm trying to understand how to load it. Can I use GRUB "insmod" command or something like that for this?
GRUB's "insmod" command loads GRUB drivers for GRUB. If you want GRUB to load drivers (or any other files) for your OS, use the "module" command. From your OS, you can access those files through the Multiboot information structure.
KrotovOSdev wrote:And I also read Device Management article and it says that I can not to write my own drivers but write only an interface for them and use already existing drivers. Am I right?
Yes. Which interface do you plan to use?
I'm going to use EDI because it's easier to start with, isn't it? According to article about drivers, I can only choose UDI or EDI, or maybe there are some other interfaces?
Octocontrabass
Member
Member
Posts: 5218
Joined: Mon Mar 25, 2013 7:01 pm

Re: GRUB modules as drivers

Post by Octocontrabass »

KrotovOSdev wrote:I'm going to use EDI because it's easier to start with, isn't it?
EDI should be easier than UDI.
KrotovOSdev wrote:According to article about drivers, I can only choose UDI or EDI, or maybe there are some other interfaces?
According to the wiki, there's also CDI. But you could, in theory, implement the driver interface from any OS to use the drivers from that OS.
KrotovOSdev
Member
Member
Posts: 40
Joined: Sat Aug 12, 2023 1:48 am
Location: Nizhny Novgorod, Russia

Re: GRUB modules as drivers

Post by KrotovOSdev »

Octocontrabass wrote:
KrotovOSdev wrote:I'm going to use EDI because it's easier to start with, isn't it?
EDI should be easier than UDI.
KrotovOSdev wrote:According to article about drivers, I can only choose UDI or EDI, or maybe there are some other interfaces?
According to the wiki, there's also CDI. But you could, in theory, implement the driver interface from any OS to use the drivers from that OS.
I think I got it. Thank you.
Post Reply