Git Product home page Git Product logo

gnumach_smp's People

Contributors

0xffea avatar almuhs avatar ams avatar ananon-user avatar avarzille avatar civodul avatar dm0- avatar elmig avatar flavioc avatar guillemj avatar hexagonal-sun avatar jbranso avatar jeremie-koenig avatar jrtc27 avatar kalleolaviniemitalo avatar nabijaczleweli avatar nwalfield avatar phcoder avatar rekado avatar richardbraun avatar rmacc19 avatar slp avatar snogglethorpe avatar stesie avatar sthibaul avatar stweil avatar tschwinge avatar z3ntu avatar zamaudio avatar zheng-da avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gnumach_smp's Issues

Improve testing using docker system

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!

LAPIC and IOAPIC addresses on x86

@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.

Implement cpus enumeration

To enable all processors, we need to find what processor exists in the machine. We can do It reading ACPI tables, where we can find the local APIC and IO APIC list, and the address where lapic is mapped.

We can find an example here: . This example can be ported to gnumach to solve this issue.

Problems during Hurd boot after add AP processors to the kernel

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.

assembly routine in a unsecure fixed memory address

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

Crash when ncpu != 2

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.

Boot log on ThinkPad X200

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.