almuhs / gnumach_smp Goto Github PK
View Code? Open in Web Editor NEWSMP implementation in GNU Mach
License: GNU General Public License v2.0
SMP implementation in GNU Mach
License: GNU General Public License v2.0
Hi all!
I have been checking a bit the project and I think docker would be a good tool to integrate here in order to aid the testing.
If we add the gnumatch.gz on boot folder on a docker image and instead of copying it on our own machine we can avoid the reboot process.
¿makes sense?
note: Really good job here!
With patches (https://github.com/zamaudio/GNUMach_SMP/tree/gcc9-smp-debian) I got it to boot with network on native hardware.
Keystrokes not working, ssh worked. Here is log from my terminal over ssh!
demo@zamhurd:~$ sudo cat /var/log/dmesg
GNU Mach 1.8
acpi found 2 cpus
biosmem: physical memory map:
biosmem: 000000000000000000:00000000000009fc00, available
biosmem: 00000000000009fc00:0000000000000a0000, reserved
biosmem: 0000000000000f0000:000000000000100000, reserved
biosmem: 000000000000100000:00000000007d74d000, available
biosmem: 00000000007d74d000:000000000080000000, reserved
biosmem: 0000000000f0000000:0000000000f4000000, reserved
biosmem: 000000000100000000:000000000180000000, available
vm_page: page table size: 513853 entries (28104k)
vm_page: DMA: pages: 4080 (15M), free: 0 (0M)
vm_page: DMA: min:500 low:600 high:1000
vm_page: DIRECTMAP: pages: 219136 (856M), free: 208053 (812M)
vm_page: DIRECTMAP: min:10956 low:13148 high:21913
vm_page: HIGHMEM: pages: 290637 (1135M), free: 0 (0M)
vm_page: HIGHMEM: min:14531 low:17438 high:29063
LAPIC mapped: physical: 0xfee00000 virtual: 0xf95e1000 version: 0x50014
GNU Mach 1.8
acpi found 2 cpus
biosmem: physical memory map:
biosmem: 000000000000000000:00000000000009fc00, available
biosmem: 00000000000009fc00:0000000000000a0000, reserved
biosmem: 0000000000000f0000:000000000000100000, reserved
biosmem: 000000000000100000:00000000007d74d000, available
biosmem: 00000000007d74d000:000000000080000000, reserved
biosmem: 0000000000f0000000:0000000000f4000000, reserved
biosmem: 000000000100000000:000000000180000000, available
vm_page: page table size: 513853 entries (28104k)
vm_page: DMA: pages: 4080 (15M), free: 0 (0M)
vm_page: DMA: min:500 low:600 high:1000
vm_page: DIRECTMAP: pages: 219136 (856M), free: 208053 (812M)
vm_page: DIRECTMAP: min:10956 low:13148 high:21913
vm_page: HIGHMEM: pages: 290637 (1135M), free: 0 (0M)
vm_page: HIGHMEM: min:14531 low:17438 high:29063
LAPIC mapped: physical: 0xfee00000 virtual: 0xf95e1000 version: 0x50014
pcibios_init : BIOS32 Service Directory structure at 0xf6ba0
pcibios_init : BIOS32 Service Directory entry at 0xff046
pcibios_init : PCI BIOS revision 2.10 entry at 0xffa40
Probing PCI hardware.
AHCI SATA 00:1f.2 BAR 0xe1625000 IRQ 11
ahci: 00:1f.2: Odd number of ports 2, assuming 4 is correct
sd0: HITACHI HTS723232A7A364, 298GB w/16384kB Cache
floppy0: no floppy controllers found
probing scsi 5/22: Adaptec 1542 Invalid address for shpnt with 1542.
Invalid address for shpnt with 1542.
probing scsi 18/22: Western Digital WD-7000 Failed initialization of WD-7000 SCSI card!
probing scsi 21/22: Iomega parport ZIP drive ppa
@AlmuHS: in coreboot, the LAPIC address is hardcoded to 0xfee00000 as it never changes on any x86 machine, so it's not really necessary to read it out of the ACPI. Same for the IOAPIC address, it is always 0xfec00000.
Booting with 2 cpus, there are some problems during the Hurd booting.
The pfinet server generate some problems and crash during DHCP process. Setting a static IP, the system pass the network configuration step, but crash when sshd service try to start.
Forcing the fail of netdde and pfinet servers, the system skips the network configuration and got to finish the booting, loading the tty with the login screen. But the tty doesn't reply to keyboard inputs, so It's impossible to sign in in the system.
When the system is booted from a number of cpus less or higher than 2, the system crash
With an only CPU, the system crash during the booting start. It seems related with the cpu enumeration, in acpi_setup()
With 3 or more CPUs, the system crash after boot the first AP. It only happen when paging is enabled. Disabling the paging configuration, all CPUs got to boot successfully. But paging is needed to get that the CPUs are useful.
Once we will get the memory mapped APIC address from ACPI, we need to replace the APIC address set in imps/apic.h with the variable address get from ACPI
The assembly routine to configure the AP processors (cpuboot.S), after raise startup IPI, is stored in the 0x7000 address. This address is not reserved for the BIOS, so It's possible that can be overwritten for another process.
Samuel Thibault recommended to reserve a memory page for this routine, and for the GDT and IDT structures.
<youpi> you then need to reserve a well-known 16bit area from biosmem
<youpi> i.e. make biosmem_bootstrap() etc remove it from the allocation pool
<AlmuHS> Isn't It dangerous?
<youpi> on the contrary, you *have* to do this to be on the safe side
<youpi> at that point nothing is allocated yet
<youpi> so it's the right time to reserve areas
<AlmuHS> apboot is reserved in mp_desc.c
<AlmuHS> I think
<youpi> nothing reserved AP_BOOT_ADDR
<youpi> in your source code it's just a random value
<AlmuHS> oh, It's true!!
<AlmuHS> Now, I remember that 0x7000 is the address where I copy the routine, with a memcpy
<AlmuHS> in mp_desc.c, in start_other_cpus(), before the for loop
<youpi> line 65, I don't think you need to use M()
<youpi> because you have enabled protected mode, you have access to the full 32bit space
<youpi> line 59, I believe lgdt can take a relative address
<youpi> so you don't need to use the absolute 0x7000 address either
<youpi> see linux' arch/x86/realmode/rm/trampoline_32.S
<AlmuHS> I go to test It
<AlmuHS> but I remember that my previous test without M used to crash
<youpi> probably because your temporary gdt misses the segmentation
<youpi> you need to make it take KERNELBASE into account
<AlmuHS> It's possible
<AlmuHS> the temporary gdt is in the bottom of the file
<youpi> yes, and it doesn't talk about KERNELBASE at all :)
<youpi> see how the real gdt is configured
<AlmuHS> I see
<AlmuHS> Really, I don't know if temporary gdt is really necessary
<youpi> you could copy the real gdt to your trampoline area
<youpi> (and idt)
<youpi> to be able to directly load the right one
<youpi> i.e. the set up would be:
<youpi> - allocate a page
<youpi> - copy the trampoline code (your cpuboot.S) there
<youpi> - copy the idt/gdt at the right place in it
<youpi> - send the IPI
<youpi> - once CPU is booted off that trampoline code, release the page
<youpi> the page needs to be allocated <= 1M
<AlmuHS> ok, I'll take notes about this
The currently intel_startCPU() implementation is buggy and useless. We need to rewrite this function to raise StartUp IPI to a specific cpu and update Its registers correctly.
When this line is commented, the cpu 1 returns an exception and crash
https://github.com/AlmuHS/GNUMach_SMP/blob/wip/i386/i386/mp_desc.c#L358
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.