Little help on the way...
Posted: Thu Jan 27, 2011 9:22 am
Hi.
A little introduction: my name is Sergio, from Barranquilla, Colombia. I'm 21 and about to start undergraduate study in mathematics. I'm currently working on a little operating system following the microkernel paradigm. My OS and programming understandings are from first-level books like the book on 4.4BSD, Lion's commentary on Unix V6, not from academia. I prefer using *BSD operating systems primarily because of their communities, BSD's rich history and that I do not share the concept of freedom imposed by the GPL.
A brief description of what have been done follows in the operating system I am attempting to develop:
1. BIOS jumps to custom MBR code.
2. MBR simply scans the partition table, and loads sector 0 from the partition selected. This loaded program is called first.
3. First is just 1 sector big, enough to read sector 1 from the partition and parse the ELF header of the next program. This one is called second. So, first loads up second.
4. Second prints some stuff using the BIOS, handles the a20-gate stuff, relocates IRQ's, sets up a temporary Interrupt Descriptor Table for handling interrupts when going 32-bits but before loading kernel. Then it loads the kernel, goes 32-bits and, initializes a small command-line interpreter.
Up to here, I have the following questions:
- I understand, from Intel SPG part 1 that local apic is enabled at boot. Is it still enabled after BIOS? or is the master 8259 connected directly to the INT/NMI pins? what about the ioapic? is it enabled? if so, is it acting as a 8259? is its outputs connected to LINTS? or directly to the processor interrupt pins INT/NMI? I really feel like needing a better background to this point to be able to understand how I might latter further configure an interrupt system.
- Does the APIC system work in real-mode?
- What happens to the APIC/8259 when going to protected-mode?
5. The terminal-handling facilities receives keystrokes until a new line. The 'start' command jumps to the kernel.
6. The kernel understands the simple format of a custom file-system. It loads the user-level servers, set up heaps for them, uses ACPIe820 for physical-memory mapping, creates paging structures, enables paging, and invoke each user-level server for the first time. The mechanism for interprocess communication is virtual-memory mapping.
7. The IO server probes devices, I think the old (unreliable?) way, that is, scanning all possible devices through CONFIG_ADDRESS/CONFIG_DATA IO space addresses.
Questions:
- Is this mechanism (probing buses) unnecesary/unreliable?
- According to the state of the APIC/8259 up to here, I mean, because I really ignore if the CPU is receiving interrupts directly from 8259 or through the local apic: if in legacy mode (8259 interrupts the CPU directly), can I still use the MP/ACPI table mechanism for devices? if receiving interrupts from local apic, are legacy devices connnected to ioapic? are they connected to 8259 and this, in turn, connected to ioapic?
- Probing devices the old way, how can I probe devices behind the PCI-ISA bridge?
- The result of device probing tells me, through the INTERRUPT LINE from PCI configuration space registers what IRQ all devices are issuing, but then I see that the PCI-ISA bridge, which is a multifunction device part of the SB600 chip from amd, issued IRQ0. In fact all functions from this device have IRQ0 at the INTERRUPT LINE. Is this valid?
Thanks for reading and I hope to find answers here.
A little introduction: my name is Sergio, from Barranquilla, Colombia. I'm 21 and about to start undergraduate study in mathematics. I'm currently working on a little operating system following the microkernel paradigm. My OS and programming understandings are from first-level books like the book on 4.4BSD, Lion's commentary on Unix V6, not from academia. I prefer using *BSD operating systems primarily because of their communities, BSD's rich history and that I do not share the concept of freedom imposed by the GPL.
A brief description of what have been done follows in the operating system I am attempting to develop:
1. BIOS jumps to custom MBR code.
2. MBR simply scans the partition table, and loads sector 0 from the partition selected. This loaded program is called first.
3. First is just 1 sector big, enough to read sector 1 from the partition and parse the ELF header of the next program. This one is called second. So, first loads up second.
4. Second prints some stuff using the BIOS, handles the a20-gate stuff, relocates IRQ's, sets up a temporary Interrupt Descriptor Table for handling interrupts when going 32-bits but before loading kernel. Then it loads the kernel, goes 32-bits and, initializes a small command-line interpreter.
Up to here, I have the following questions:
- I understand, from Intel SPG part 1 that local apic is enabled at boot. Is it still enabled after BIOS? or is the master 8259 connected directly to the INT/NMI pins? what about the ioapic? is it enabled? if so, is it acting as a 8259? is its outputs connected to LINTS? or directly to the processor interrupt pins INT/NMI? I really feel like needing a better background to this point to be able to understand how I might latter further configure an interrupt system.
- Does the APIC system work in real-mode?
- What happens to the APIC/8259 when going to protected-mode?
5. The terminal-handling facilities receives keystrokes until a new line. The 'start' command jumps to the kernel.
6. The kernel understands the simple format of a custom file-system. It loads the user-level servers, set up heaps for them, uses ACPIe820 for physical-memory mapping, creates paging structures, enables paging, and invoke each user-level server for the first time. The mechanism for interprocess communication is virtual-memory mapping.
7. The IO server probes devices, I think the old (unreliable?) way, that is, scanning all possible devices through CONFIG_ADDRESS/CONFIG_DATA IO space addresses.
Questions:
- Is this mechanism (probing buses) unnecesary/unreliable?
- According to the state of the APIC/8259 up to here, I mean, because I really ignore if the CPU is receiving interrupts directly from 8259 or through the local apic: if in legacy mode (8259 interrupts the CPU directly), can I still use the MP/ACPI table mechanism for devices? if receiving interrupts from local apic, are legacy devices connnected to ioapic? are they connected to 8259 and this, in turn, connected to ioapic?
- Probing devices the old way, how can I probe devices behind the PCI-ISA bridge?
- The result of device probing tells me, through the INTERRUPT LINE from PCI configuration space registers what IRQ all devices are issuing, but then I see that the PCI-ISA bridge, which is a multifunction device part of the SB600 chip from amd, issued IRQ0. In fact all functions from this device have IRQ0 at the INTERRUPT LINE. Is this valid?
Thanks for reading and I hope to find answers here.