• Please review our updated Terms and Rules here

Rewriting my Nabu floppy disk bootloader 😵

usotsuki

Experienced Member
Joined
Nov 30, 2010
Messages
85
So recently I wrote some code - both ROM code and code that could be sideloaded from the virtual head end - to boot the Nabu CP/M 3.1 floppy disks. And...in MAME...it works.

Problem is, it's gone Schrödinger - I had people tell me it didn't work on metal, and I haven't since had it work. Doesn't help I know absolutely nothing about the FD-1797 chip and wasn't able to really put together working code by Ring TFM. :/ (Not for lack of trying.)

I think I need to gut it and rewrite it. :/ But I have no idea where even to start.
 
I'm not exactly sure what you are meaning - but generally some good debugging tools and working out where it starts to go wrong is a good start - Once you understand why it's not working, you'll probably quickly be able to fix it.
 
I suspect it's timing. But I don't understand the hardware all that well to begin with.

All I have to test against is MAME (I do have a Nabu with a FDC, but no floppy drives, so still not enough metal to test with), and apparently its emulation of the FD-1797 is a little too forgiving.
 
An easy start then would be some LEDs on a 34 way connector to see what is reaching the cable. If you make it pass-through, then if you get a FDD, you can use it to see what the FDD should be doing.
 
Hi there usotsuki,

I recently put together the nabu FDC project and, after getting all the basics working (I'm using one gotek and one 3.5 drive, and both can boot with the community images), I have begun exploring the intricacies of the physical nabu floppy boot process. I don't like that the working nabu floppy images are such a black box -- I like to understand things down to the root :) That said, I'm VERY new to this topic -- I'm working through some disassembled samples of the nabu 8k ROM and the assembly used in the Ishtur CPM project (which seems to boot floppies in emulation, but it doesn't work on real hardware). Anyway, I wanted to ask if you've made any progress on your bootloader? I can't seem to find much documentation on how the NABU maps the FDC port addesses, which is adding to the challenge. Looking through the 8k ROM code, there are a host of odd loops and delays, so I would agree with you that timing seems to possibly be problematic on the physical hardware.

At any rate, I just wanted to see if you've pursued this (to me) very interesting topic!

Cheers, A
 
No dice. :(

My source describes the port addresses but it's a bit cryptic.
 
Hi there!

Too bad, but no worries -- I was digging around last night and stumbled across the rewritten ROM code done for the Marduk project (opennabu), which was far better documented, so I've got a slighty clearer idea of how the controller registers are laid out. The search continues!! :)

Best, A
 
That's the code I was talking about. 😜 That's what I'm trying to fix. ;)
 
LOLLL -- well, there you go, we all end up in the same place :) From what I've gathered so far, if the adapter is found at (for example) port 0xCF, then 0xC0 will be the WDC 1797 command (and possibly status) register, 0xC1 track reg, 0xC2 sector, and 0xC3 data. The others I don't know, perhaps not used? So far the commands being send to the command register seem to match the 1797 documentation (though I'm not finished going thru the code by a long shot). There are some oddball commands I don't understand yet, like sending 0x02 to 0xCF to "select drive"? Seems to be used to select drive A, but why 2? and 0 seems to be sent to 0xCF to "disable" floppies, which kind of makes a little more sense. Anyway, still searching. My goal is to manage a read of a raw .img formatted disk rather than relying on the voodoo-y track 0 gap (I assume drive geometry?) data that the default setup seems to require on the disk. My (naive) thought is that if I can get the system to read sector 1 from track zero off a know format (eg the osborne1 used by Ishkur), I can proceed from there. I do think timing is going to be awful tho, so I might not succeed :)

Best, A
 
I can't remember the 0xCF (DF, EF, FF) voodoo, or where I read it. All I tried to do was read head 0, track 0, sector 1 to 0xC000 and run it.

It might actually have been the Ishkur bootstrap or something, or perhaps MAME. My memory's failing me. :/
 
Back
Top