Giter Club home page Giter Club logo

nt4.0onmac's Introduction

Windows NT 4.0 on PowerPC Macs

This repository contains a lot of leaked Windows NT 4.0 source code. By reading it, you lose the right to contribute to ReactOS. Oh, well.

This is an attempt at running the Windows NT 4.0 kernel on the PowerPC Apple computers.

TODO

  • veneer.elf "works" on QEMU
  • veneer.elf works on a real Mac (it crashes on my iBook G3 Dual USB)
  • veneer.elf boots the NT kernel on QEMU (no, it doesn't, it crashes after jumping at 0x80600000)

Building

This project uses clang for compiling and QEMU for emulation.

  1. Make these folders: dmg_mount/os/winnt, then copy the SETUPLDR file from a Windows NT 4.0 Service Pack 1 CD and rename it to osloader.exe
  2. Run make
  3. Run make again, I screwed up somewhere, and you need to run Makefile twice in order to generate an ISO
  4. Run make qemu, then type in boot cd:,\ppc\veneer.elf

nt4.0onmac's People

Contributors

rndtrash avatar

Stargazers

 avatar

Watchers

 avatar

nt4.0onmac's Issues

Nice attempt.

You need to consider endianness here. Jumping to ppc little endian code with ppc and memory controller in big endian mode won't work :)

Although it is possible. I'm working on my port now, using same ideas/high level arc firmware implementation/... as my NT4 PPC port to Wii (which is on hold due to weird issues, I don't have a USB Gecko and getting an iBook G3 from Yahoo Auctions was cheaper!)

It requires endianness swapping all code on load (and hooking all PE loading code for that); and patching all 16/32-bit load/store instructions to invalid instructions, and then emulating those by program exception handler.

That's the basics, additional kernel patches are required for getting past kernel init, and dealing with page tables, and low level exception handler stuff, etc.

Additionally, OF maps 1:1 physical->virtual address. NT boot requires a mapping where (the first 256MB of) physmem is at virtual address 0x8000_0000 (this is used in kernel-mode when kernel is running, osloader loads kernel and boot drivers/etc there), which is like the GameCube/Wii but not like OF. On UniNorth systems the mac-io device is mapped at 0x8000_0000 to 0x8008_0000, with usb controllers each using a page after that.

The trick here is that the ARC system table must be at 0x8000_4000, and 0x4000 bytes of MMIO there is afaict entirely unused by Apple's OF (it might be a mirror, I'm not sure), so one can make a loader that unmaps that area and remaps it to physical address 0x4000, maps physmem starting from 0x8009_0000, loads second stage ELF there and jumps to it (the hooks would require being based in the same mapping as NT uses)

Here's setupldr running on real iBook G3, erroring out due to osloader checking PVR against a hardcoded list, with extra patches for that required (basically assuming everything not in that list is a 750 which is the latest processor supported by NT4 PPC). Works under QEMU emulation too, and boot currently gets through early kernel init and calls the HAL, which is yet to be written.

Theoretically little endian mode should work on grackle systems (the reason why it's notorious for bricking is because the old grackle endianness switching code remained in place on uninorth systems, hence a crash when OF comes up after the bong and attempts to switch endianness). Apple even mapped the mac-io controller there to 0x8080_0000 so veneer could run, veneer maps first 8MB physmem unconditionally for the NT boot/kernelmode mapping.

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.