3 ms·
Ask HN: x86 SMP with cpus on different processor modes
It's possible to setup SMP on intel x86 processors and leave the BSP in real mode?
I have the following setup in mind:
- BSP in 16-bit real mode;
- 1 AP in 32-bit protected mode;
- Every other cpu off;
Why?
The project is a simple assembler IDE that runs in bare metal, and could be used to fast prototype of ideas talking directly to real hardware. The code is assembled in-memory, and then to "test" is just a jump to the assembled location. Will be used most to learn/teach OS design.
The use case is very simple (only need disk and VGA), but I need 4GB address space. Being able to use BIOS services could make it a trivial project. My initial plan was to use Unreal mode for it, but it turns out to be error prone.
My idea is use the AP processor to develop the simple OS (it's just editor TUI + assembler), and invoke the BSP processor to access disk. I'm aware that will require a mutual exclusion lock, but I never programmed a SMP and every reference online uses protected mode BSP.
It makes sense? What kind of problems I have in this design?
Thanks!
Project details: https://github.com/tiago4orion/EnzOS
Plan: https://github.com/tiago4orion/EnzOS/blob/master/plan.md
- sinatosk 10y agoI ain't an expert in x86 so I'm not sure... only read some of Intel's manual but judging by the code at https://github.com/mit-pdos/xv6-public https://github.com/mit-pdos/xv6-public file "entryother.S" is asm that executes on AP's and "bootasm.S" executes on the BSP... both after the BIOS so... maybe? maybe that's what your looking for?
- i4k 10y agoI'd already read the booting process of xv6, but it does IPI in protected mode too. Maybe BSP will need to enter pmode to make any IPI call anyway. Thanks for the help!