PowerPC Port

From ReactOS Wiki
Revision as of 04:41, 1 April 2005 by (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PowerPC port plan

  • Tools Issues
    • powerpc binutils patch for powerpcle-win32
    • Build powerpc-linux-elf binutils-2.15 with --prefix=/usr/local/mppcw32 --program-prefix=mppcw32-
    • Build a patched powerpcle-cygwin32 binutils-2.15 with --program-prefix=ppcwin32- --prefix=/usr/local/ppcwin32 --enable-targets=powerpc-unknown-linux-gnu
    • copy the mingw runtime headers to /usr/local/mppcw32/powerpc-linux-elf/sys-include
    • Build a powerpc-linux-elf gcc-3.4.3 with --prefix=/usr/local/mppcw32 --program-prefix=mppcw32-
    • ln -s mppcw32-gcc, mppcw32-g++, mppcw32-c++ to ppcwin32-gcc etc in /usr/local/ppcwin32/bin
    • pearpc patch
  • 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
  • Tinker with MACSbug
    • X
  • 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.
  • Learn to boot program on real Mac
    • Done (boot enet:,\hello.of)
  • Integrate OFw code with freeldr, switch to fb8 for display
    • Integration complete
    • fb8 next
    • Write these ofw proxy functions:
      • print
        • Done
      • disk block read/write
        • Done
      • find device
        • Done
      • get property
        • Done
      • open
        • Done
      • map/unmap
    • 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:,\ofwldr
 FreeLDR starting
 Returning memory map (32768k total)
 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.
  • 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
    • rtl has some ppc problems. resolve these before checking in.
      • Fix stack assumptions. Use stdarg.
      • Fix math/libgcc2.h properly mode(XF)
      • Decide what to do about PC cruft (int13, floppy motor, etc)
      • Keep writing Mach* functions
  • Really learn MACSbug
    • X
  • Write an OFw/PPC specific HAL (NetBSD knows how to call OFw from a running OS)
    • Write little-endian stubs for calling open firmware
      • No need at this level, will use real drivers
    • Lots of things NOPs at first
      • X
    • Focus on text out routines etc
      • X
    • Display ownership
      • Do this in FreeLoader
    • Port I/O (Easy on PPC, EIEIO)
      • Remember that this is LE and we have to do some things differently.
    • 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
    • Trap handler
    • Stack switching
    • MM functions
    • ASM in rtl directories (should be able to steal most from netbsd)
    • Kernel debugger -- learn to drop into MACSbug
    • Kernel exit -- leave into poweroff or OFw
    • Use PSL_POW to emulate pentium HLT instruction
  • Drivers
    • Lean on OFw for disk, screen and keyboard at first
    • Move away from OFw to HW access
      • Keyboard + Mouse
      • Disk
      • Others
      • USB when available
  • Have ReactOS on Macintosh
  • Resolve remaining tools issues
    • crossgcc strategy
      • Done. Use powerpc-unknown-linux with -mlittle, convert to coff using objcopy.
    • ABI issues
    • MinGW porting
    • crt0
    • patches to gcc/binutils/mingw people
      • Only binutils patches needed ATM.
    • scriptified build
  • Make macsbug/bomb screensaver
       So I sez to him...  The real way
       that it should be done is to...