Hi all,
Im interested in implementing a HAL layer.. From what i can understand, its basically a motherboard driver?
If this is true.. Is it possible to detect what the motherboard supports and provides? (RTC, DMA, Buses?)
Thankyou
Mike Brown
HAL, Motherboard Detection
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: HAL, Motherboard Detection
All the information you'll need is availabel in the ACPI tables. On most systems, you'll have a root "System driver"; for PCs, this will probably be the "ACPI PC" driver. You come across a device type defined in ACPI (E.G. a root PCI bus) and load the corresponding driver.
The concept of a "HAL" or "System driver" is really that of a potentially virtual "root bus" for enumerating the devices of the system. The amount of dynamism there can vary; on an ARM SOC, for example, you would probably have a root driver which enumerated a bunch of hardcoded devices, of which perhaps only a few (e.g. I2C, USB) would serve as bus bridges.
The concept of a "HAL" or "System driver" is really that of a potentially virtual "root bus" for enumerating the devices of the system. The amount of dynamism there can vary; on an ARM SOC, for example, you would probably have a root driver which enumerated a bunch of hardcoded devices, of which perhaps only a few (e.g. I2C, USB) would serve as bus bridges.
Re: HAL, Motherboard Detection
The HAL is similar to a motherboard driver in a way...From what i can understand, its basically a motherboard driver?
The HAL is a layer between the Kernel and the hardware. The Kernel does not access the hardware directly, but interfaces with the HAL, and the HAL does the hardware work. I like to think if it a bit like an API (although I'm sure that's not entirely accurate)...
This makes things easier when porting to different hardware, as the Kernel doesn't require many changes, if any. Just the HAL.
You could use the HAL for detecting hardware, but you don't necessarily have to
(Minor disclaimer... I'm still working on my OS and HAL, so there may but much more to it than I'm letting on)
Re: HAL, Motherboard Detection
Thankyou!
I think the ACPI is what im after, but it seems incredibly complex for what i would like to start with.
I have had a look at the output of acpidump on linux, Would it be right to say that in order to find out what chips, processors and memory are available, i only need read the DSDT?
Mike Brown
I think the ACPI is what im after, but it seems incredibly complex for what i would like to start with.
I have had a look at the output of acpidump on linux, Would it be right to say that in order to find out what chips, processors and memory are available, i only need read the DSDT?
Mike Brown
Re: HAL, Motherboard Detection
You need to read the MADT (signature == APIC). It gives interrupt and APIC info. Some processor info can be inferred from this.
Memory info should come from the BIOS E820 services.
Some computers also have an MP table. This can be a little easier to read.
Memory info should come from the BIOS E820 services.
Some computers also have an MP table. This can be a little easier to read.
If a trainstation is where trains stop, what is a workstation ?
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: HAL, Motherboard Detection
I strongly suggest you do what Linux, Darwin, Solaris, FreeBSD and most others do: Use Intel's ACPICA. It's well tested, its a full implementation, it is far easier than implementing it on your own.