OK, I think for this project to get any further, I have attached the current CF / HDD code...
http://www.filedropper.com/gddebug22-8-12ozone
EDIT: I just realized that I'm hijacking this thread. Please let me know if this should be moved, or if a new thread should be created.
@abs - no DCEXT adapter is needed! You just need to solder an IDE cable to your DC's G1 port. (details below).
The GDD needs to be left plugged in to get the DC to boot, then the CF / HDD needs to be set to Slave mode.
Usual disclaimer - the above code is not booting any images yet!
I can boot to the first part of Crazy Taxi (PAL GDI) bootloader, but it gives an AICA_DRV -1 error.
I'm guessing this is because it can't find the AICA_DRV file in the image, but it could be something else? SWAT says this error showed up quite a bit?
It could be that I'm trying to boot native GDI's and there is some extra protection in the stock BIOS, or stuff that needs initializing first?
You can try loading a CDI with this, but we need to confirm that my TOCs are correct (I don't think the CDI one in my code is correct atm).
A big problem for me is not having any debug output from the DC once the game image is started.
I can't seem to get serial output working after booting from SD, and I don't really want to boot from CD-R every time.
The DMA routines are fairly straightforward (info taken from the DC System Guide), but I still can't get it to poll for the end of a DMA without freezing?
So, I've had to add some big delays in the DMA routines to ensure the current DMA has completed.
I haven't tried using interrupts in case the stock BIOS has attached routines to ints already. (the idea being to boot a GDI leaving most of the stock stuff intact).
I attempted to add some stuff for grabbing the start FAD of the binary (1ST_READ.BIN etc.) from the GDI image.
This is unfinished though, so you need to specify the start FAD of your binary in the code (there are a few examples in there).
The image itself is simply copied directly onto my CF card using your favourite hex editor (WinHex etc.) - no filesystem!!
To calc the start LBA on the CF / HDD, I'm simply multiplying the GD FAD by 4 (due to the difference in GD / ATA sector sizes).
So, if "track03.iso" normally starts at FAD 45150, it needs to be copied onto CF / HDD starting at LBA 180600.
I compiled the gd debug code under DC Dev ISO R4 / Cygwin.
To try loading IP.BIN and a binary, you'll need to compile GD debug to load into high memory...
To do this under Cygwin / KOS, I just modified the environ_dreamcast.sh script (before compiling) like this...
export KOS_LDFLAGS="${KOS_LDFLAGS} -ml -m4-single-only -Wl,-Ttext=0x8cd00000"
The resulting binary will of course need to be loaded and run from the correct offset on the DC (using dc-load or the DS console etc).
In my case, I just added an app xml to create a new icon on the DS desktop.
See this post...
http://dcemulation.org/phpBB/viewtopic.p...3#p1032933
For the CF / HDD connection, I just cut one end off a 40-pin IDE cable, stripped and tinned every wire, then soldered them to the DC G1 port test pads.
If you fancy a bit of soldering, here is a diagram....
If you give this a try it is AT YOUR OWN RISK! blah blah blah.
btw, I've set the GD debug app to load 16 sectors (32KB) at a time simply so it will load all of IP.BIN into DC RAM.
Then, (after you've modified the code for the correct start FAD) press start, and it will load 1ST_READ.BIN at 0x8c010000 (directly after IP.BIN).
I can't really explain more than that or this post would be even bigger.
(it will make more sense once you read through the code).
I'm no expert programmer, so there will be many silly mistakes and very rough code.
It would be great to get some extra brains on this.
I can't wait to start booting GDI's from HDD.
OzOnE.