From b2eeeae652295d60c5cefff31ef4a602299b5dbd Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Thu, 22 Oct 2020 15:13:24 -0700 Subject: [PATCH] Add sources --- Dockerfile | 9 ++++++ README.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++ xboxdash/Makefile | 4 +++ xboxdash/main.c | 21 +++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 xboxdash/Makefile create mode 100644 xboxdash/main.c diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1504969 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM ubuntu:18.04 +RUN apt-get update && apt-get upgrade -y +ENV PACKAGES sudo unzip genisoimage +RUN apt-get -y install $PACKAGES +RUN dpkg -l $PACKAGES | sort > /packages.txt +ENV FEATURES clang pyyaml +RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo +USER docker +CMD /bin/bash diff --git a/README.md b/README.md new file mode 100644 index 0000000..1e5510a --- /dev/null +++ b/README.md @@ -0,0 +1,79 @@ +Copyright-Free Xbox HDD Image +============================= + +This repository serves as a way to document how to create an Xbox HDD image, +mostly for use with [xemu](https://xemu.app), free of any copyrighted content. + +Download +-------- +If you're in a hurry, you can [download a pre-built image here](https://github.com/xemu/xemu-hdd-image/releases). + +Do It Yourself +-------------- +If you would like to create an image for yourself, containing your own files, +you can follow these instructions. It's a bit hands-on, but if you've read this +far you're probably okay with that. This will involve building a dummy +dashboard, using [XboxHDM](https://www.reddit.com/r/originalxbox/wiki/xboxhdm#wiki_using_xboxhdm) +to create a helper bootable ISO, and a QEMU VM to run the ISO and create the +drive. + +You may want to start by building the dummy dashboard using +[nxdk](https://github.com/XboxDev/nxdk). Make sure to update the Makefile with the +path to your nxdk install. Otherwise, copy your desired dashboard and optionally +and "E drive" files you want on the drive over to this directory. + +Next you'll want to run the `make-iso-*.sh` script that comes with **XboxHDM +v1.9**. This script will create a bootable ISO image. You can run XboxHDM +natively on Linux or Windows (not tested by me), but I chose to simply run it +inside of a Docker container: + + docker build -t xboxhdm . + docker run --rm -it -v ${PWD}:/work xboxhdm + +Create a working directory: + + mkdir /tmp/xboxhdm + pushd /tmp/xboxhdm + +Unzip XboxHDM: + + unzip /work/xboxhdm_v1.9.zip + cd xboxhdm + +Now copy over the dummy dash and create the empty `TDATA` and `UDATA` folders: + + cp /work/xboxdash.xbe linux/C/ + mkdir -p linux/E/TDATA linux/E/UDATA + +Finally, run the tool and copy over the resulting file: + + ./make-iso-lin.sh + cp linux.iso /work + +Now we should have a file called "linux.iso" in this directory. You could burn +this to a CD, and run it on your PC after connecting a real HDD, but we aren't +going to do that. Instead, to create a virtual disk image, we will use a virtual +machine: QEMU! + +But before we can boot it, we need to create a virtual hard disk. Use `qemu-img` +to create an 8G qcow2 formatted image: + + qemu-img create -f qcow2 xbox_hdd.qcow2 8G + +Now you have an empty virtual drive. Let's fire up our virtual machine: + + qemu-system-i386 \ + -drive index=0,media=disk,file=xbox_hdd.qcow2 \ + -drive index=1,media=cdrom,file=linux.iso + +Next follow the on-screen instructions, which basically go as follows: + - Enter 2 to boot in text mode + - Type xboxhd at the command prompt to start the helper script + - Enter 'yes' to confirm + - Enter 1 to "build a new Xbox HD from scratch" + - Continue to confirm through the warnings + - Confirm building a new partition table, formatting partitions, and copying files + - 8 to quit + - Type `poweroff` at the command prompt + +You should finally have a freshly minted, copyright-free Xbox hard disk image! diff --git a/xboxdash/Makefile b/xboxdash/Makefile new file mode 100644 index 0000000..2b86430 --- /dev/null +++ b/xboxdash/Makefile @@ -0,0 +1,4 @@ +XBE_TITLE=xboxdash +SRCS = $(wildcard $(CURDIR)/*.c) +NXDK_DIR = $(CURDIR)/../../nxdk +include $(NXDK_DIR)/Makefile diff --git a/xboxdash/main.c b/xboxdash/main.c new file mode 100644 index 0000000..453ba2a --- /dev/null +++ b/xboxdash/main.c @@ -0,0 +1,21 @@ +#include +#include +#include +#include "stdio.h" + +void main(void) +{ + int i; + + if (pb_init()) { + XSleep(2000); + XReboot(); + return; + } + + pb_show_debug_screen(); + debugPrint("Please insert an Xbox disc...\n"); + while(1) XSleep(1000); + pb_kill(); + XReboot(); +}