Page 1 of 1
GRUB modules as drivers
Posted: Sun Sep 24, 2023 1:45 pm
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.
Re: GRUB modules as drivers
Posted: Sun Sep 24, 2023 4:19 pm
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?
Re: GRUB modules as drivers
Posted: Mon Sep 25, 2023 5:36 am
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?
Re: GRUB modules as drivers
Posted: Mon Sep 25, 2023 11:00 am
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.
Re: GRUB modules as drivers
Posted: Mon Sep 25, 2023 12:43 pm
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.