PowerPC-Old
From ReactOS
| | This page is a candidate for speedy deletion If you disagree with its speedy deletion, please explain why on its talk page.
Watch also the Criteria for speedy deletion! |
PowerPC port plan
- Tools Issues
- TOOLS ARE COMPLETE
- Get a demo program work that prints using Open Firmware (OFw)
- Done
- Make the demo program into a function I can call from a C program
- Done
- Write OFw tree enumerator
- Done (ppc_find_pci_dev)
- Tinker with MACSbug
- X
- Tinker with OF debugger
- Learn implications (how to) switching to little-endian
- -> Doing
- Done (and patched pearpc to support little endian mode)
- Little endian ppc isn't so bad when you get to know it.
- But we're gonna be modern and BE. (X)
- Learn to boot program on real Mac
- Done (boot enet:10.10.1.102,\hello.of)
- Integrate OFw code with freeldr, switch to fb8 for display
- Integration complete
- fb8 next
- Changed my mind, use vt100 for now (done)
- Write these ofw proxy functions:
- print
- Done
- disk block read/write
- Done
- find device
- Done
- get property
- Done
- open
- Done
- map/unmap
- All done -- Wrote ofw_interface in tools
- print
- Freeldr integrated with xcoff boot program. We can copy it to the target, but can't boot it yet.
- We can transfer control to freeldr now. Now the phun. ph33r teh phun.
- We can get back to freeldr. The print proxy is complete.
- Freeldr says:
ReactOS OpenFirmware Boot Program FreeLDR version [FreeLoader v2.0] command: [freeldr-ppc] Determining boot device: Got 25 bytes of path Boot Path: enet:10.10.1.102,\ofwldr FreeLDR starting GetMemoryMap(chosen=ff8299f0) Returning memory map (32768k total) DiskReadLogicalSectors Error opening active (bootable) partition on boot drive 0x0 for file access. Error opening freeldr.ini or file not found. You need to reinstall FreeLoader. Press any key to reboot.
- Sucka, we now load freeldr.ini (and any file we want).
- Prepare your disk by creating a fat partition, then specify its openfirmware name as 'boot=disk:2' or whatever as command line to freeldr.
- 'mem=48000' <-- Use this for pearpc, to work around what appears to be a bug in the 'available' property of the /memory device.
- Use mtools to copy freeldr.ini to your fat partition.
- Sucka, we now load freeldr.ini (and any file we want).
- Start writing powerpc dirs in ReactOS tree (and test a lot)
- A few files started. Needs more.
- arch/powerpc/mach.c <-- contains freeldr and Mach* functions.
- include/of.h <-- constants for openfirmware, protos
- Ongoing but complete for now
- rtl has some ppc problems. resolve these before checking in.
- Imported a simple SetJmp/LongJmp and tested them
- Fix stack assumptions. Use stdarg.
- Done
- Fix math/libgcc2.h properly mode(XF)
- Done
- Decide what to do about PC cruft (int13, floppy motor, etc)
- GvG did some nice stuff about isolating PC cruft. I can continue here.
- RIP GvG (as a reactos developer), but thanks, I'm finally using your code.
- Keep writing Mach* functions
- Disk and partition enumeration
- Not needed. Pass boot partition as a command line parameter.
- Partition open (if any proxying is needed)
- Done.
- Added reading, got the FAT superblock from the ppc disk
- All working.
- Disk and partition enumeration
- Really learn MacsBUG
- X
- Really learn OF debugger
- Write an OFw/PPC specific HAL (NetBSD knows how to call OFw from a running OS)
- Actually, I want to do this in steps
- Write little-endian stubs for calling open firmware
- I've reconsidered a bit ... still thinking about it
- Lots of things NOPs at first
- Focus on text out routines etc
- All over it and done on PREP and OFW
- Added real hardware gdb stub for PREP
- Display ownership
- Do this in FreeLoader
- Done. Passed display address and characteristics to ntoskrnl, along with a helpful font containing digits.
- Do this in FreeLoader
- Figured out first level exception handling
- wrote an x00300 handler (DSI) that transfers control to a handler routine
- put return address in srr0 and rfi
- use sprgs as a scratchpad to avoid using user stack
- Added normal trap handling (Done)
- Attack paging, write a page enumerator that searches BATs, SPRs, pagetable
- Done, With InsertPageEntry etc. Now used to map kernel space and jump to ntoskrnl.
- Improved (ppcmmu minikernel)
- Port I/O (Easy on PPC, EIEIO)
- Remember that this is LE and we have to do some things differently.
- Exploring with the 3Com card
- Learned from #mklinux how to touch a pci controller.
- Explored the 'Eagle' a bit on my RS/6000 model 860.
- Have to figure out how to get the bus space mapped
- Interrupts with OpenPIC
- /bandit
- /psuedo-hid and /pseudo-hid
- Other Macintosh legacy stuff (MESH, MACE, ADB, video, PDS)
- Get ntoskrnl + hal loaded and crashing
- Task switching
- PRCB <-- reading in windows internals
- Trap handler
- Stack switching
- MM functions
- Reading internals, Decided to use a small (64k) page table.
- Handle page table reloads through a special arch specific function.
- We should be able to generate a PTE from address space info.
- Working on page.c. Figured out the following:
- Stuff process ID into VSID, and use high bit of VSID to indicate usermode.
- Most bits used by i386 page.c have a direct mapping in powerpc PTE.
- We'll use a two-level page table and cache into PTEG.
- No need to map the page table, since we always have SDR1.
- Reading internals, Decided to use a small (64k) page table.
- ASM in rtl directories (should be able to steal most from netbsd)
- Done: Thanks greatlord and alex
- Kernel debugger -- learn to drop into MACSbug
- Lowlevel GDB stub
- We'll need to borrow a kernel debugger ... investigate (possible sources l4ka, osfmach, netbsd)
- X
- Kernel exit -- leave into poweroff or OFw
- Use PSL_POW to emulate pentium HLT instruction
- Task switching
- Drivers
- Lean on OFw for disk, screen and keyboard at first
- X - No way. Total hardcore.
- Got screen. We're using it for tracing etc in early boot. We'll formalize text on mac fb into hal soon.
- Move away from OFw to HW access
- Keyboard + Mouse
- Disk
- Done, prep-ide.c
- Others
- USB when available
- Lean on OFw for disk, screen and keyboard at first
- Have ReactOS on Macintosh
- Resolve remaining tools issues
- crossgcc strategy
- Done. Use powerpc-unknown-linux with -mlittle, convert to coff using objcopy.
- Reconsidered, using a patched egcs-1.1.2 and binutils-2.9.1
- No ABI issues since this is the real mc'coy
- Hacked mingw crt0 to a nice mini-crt0 for us
- patches to gcc/binutils/mingw people
- Think about how to approach this
- Not done this way. Used 'alink' with elf input instead. It's unusual but works.
- scriptified build
- Probably won't need many rbuild edits
- Can do must stuff using <if name="ARCH" ...>
- Need to redo freeldr build
- Need to figure out hal and ntoskrnl build soon (even if temporarily)
- All done (RosBE-ppc)
- crossgcc strategy
- Make macsbug/bomb screensaver
Bye-bye...
So I sez to him... The real way
that it should be done is to...
"Today, I've been through hal!"

