Email or username:

Password:

Forgot your password?
Top-level
Tube🍂Time

yes, that solves the crashing problem. but data isn't getting transferred correctly, so I've got more work to do.

96 comments
Tube🍂Time replied to Tube🍂Time

weirdly enough, it works the second try!!! something on the host was prematurely turning off DMA. maybe a bug in difdiag.

Jonathan Flusser replied to Tube🍂Time

@tubetime it’s been so long since this experiment started I forget what you’re trying to do!

Tube🍂Time replied to Tube🍂Time

so the interrupt_detected flag is supposed to be set in the irq14 handler, and it is *supposed* to be set only when DMA is done. but somehow interrupt_detected is set without the IRQ handler ever being called! then the DMA operation is broken down prematurely.

Tube🍂Time replied to Tube🍂Time

using the logic analyzer, i proved that the irq14 handler never gets called. the only code that *ever* sets the interrupt_detected flag exists in this handler. it's declared as a volatile so it can't be cached in a register.

Tube🍂Time replied to Tube🍂Time

I wrote the flag value out to an unused IO port, 0x4F, so I can see it on the logic analyzer. a neat trick!

Tube🍂Time replied to Tube🍂Time

so i don't know how this flag is getting set. my hack is to preemptively clear the flag right before starting DMA, and so far, it seems to be working.

i think this code was "working" with the real ESDI drive because that one uses burst mode DMA and it finishes up very quickly, before the irq14wait routine can exit early.

Tube🍂Time replied to Tube🍂Time

decided to look at the real drive. and guess what--it's not using burst mode. the POS registers have it turned off by default. it's also slow to read the data from the spinning disk, so IBM must have figured that it wasn't really necessary.

Brian Danger Hicks replied to Tube🍂Time

@tubetime When you find yourself asking, "How did this ever work?" and it turns out the answer is "It didn't."

Tube🍂Time replied to Tube🍂Time

now I'm reading up on accessing SD cards from the Teensy 4.1. looks like SdFat is the library? could it be so easy?

Chris Hammond replied to Tube🍂Time

@tubetime I've used that library before, yes it really is easy. You probably won't set any throughput records, but it was great for writing diagnostic logs that were later read back and uploaded.

Tube🍂Time replied to Tube🍂Time

turns out it's easy but I had to reformat the SD card using the official sdcard.org utility. anyway, I've read the first sector from a real disk image!

Tube🍂Time replied to Tube🍂Time

the drive now gives the POS ID. let's try to boot!

Tube🍂Time replied to Tube🍂Time

hmm 01048200 is a drive select acknowledgement error.

Tube🍂Time replied to Tube🍂Time

the BIOS runs faster than the DIFDIAG utility, and so it seems like it is hitting a timing problem that i didn't hit before.

my drive code seems to randomly hang up and not respond correctly.

Tube🍂Time replied to Tube🍂Time

it's occasionally getting a spurious end-of-interrupt command which is really odd and points to an issue with the mailboxes (again, sigh).

but it's SO DARN CLOSE. it's transferring sectors from the IML region in the disk image.

Daniel Schwarz :toad: replied to Tube🍂Time

@tubetime What’s the end goal here, boot the laptop using a SD card that’s emulating a Micro Channel hard drive interface, via Teensy?

Daniel Schwarz :toad: replied to Tube🍂Time

@tubetime I know it’s not the point of your project, but didn’t this laptop have PCMCIA? Would one of these work as a boot drive?

Digigear SD SDHC SDXC to PCMCIA PC Card, Adapter Supports, ATA Flash Memory a.co/d/agF7LO9

Tube🍂Time replied to Tube🍂Time

figured out one problem. the disk boot routines slam the drive with an ATN and the first command word in 5.5us. the Teensy code takes too long to see the ATN and clears the command register full flag, which drops the first word. oops.

Tube🍂Time replied to Tube🍂Time

so it *almost* boots now. in fact it successfully loads the IML sectors from the hidden partition on the drive, and no longer throws an I999... error code!

Tube🍂Time replied to Tube🍂Time

my drive doesn't implement this weird feature called pseudo RBAs--it's a way to artificially limit the maximum possible block address, presumably so they can hide the partition data.

i suspect the BIOS checks this, so i'll have to implement it. ugh. that means i need to figure out this incomprehensible diagram.

Tube🍂Time replied to Tube🍂Time

holy crap it's booting I can't believe it sdfadfsdfsdfsffasdf

Tube🍂Time replied to Tube🍂Time

well, it's working well enough to run qbasic. right now the drive is read-only.

Marsh Ray replied to Tube🍂Time

@tubetime “It’s working well enough to run QBASIC”

Love it 😂

Tube🍂Time replied to Tube🍂Time

i think i need to dig into the 01290200 cache error that has been coming up. i'm concerned that an issue with my DBA-ESDI card has caused it, but i'm not sure.

Tube🍂Time replied to Tube🍂Time

looks like the cache is inside the CPU. i can't find any cache chips on the motherboard.

Tube🍂Time replied to Tube🍂Time

see? no cache or memory chips. the larger devices are probably semicustom gate array parts that IBM was fond of using. doubt they contain any cache memory.

Fritz Adalis replied to Tube🍂Time

@tubetime
@kenshirriff just posted about these CPUs. They have most of the support circuitry in the cpu itself.

Tube🍂Time replied to Tube🍂Time

looks like the error is generated by an NMI that gets tripped when the cache is being set up. could be a number of causes but in general it is an issue with the internal CPU cache.

Tube🍂Time replied to Tube🍂Time

could also be this test of the DMA controller which is also included in the same set of tests and triggers the same error code, for some reason.

Tube🍂Time replied to Tube🍂Time

hmm, the error still comes up. so i just tried what i *should have tried* at the start -- the 700 series diagnostic disk.

Tube🍂Time replied to Tube🍂Time

when the diagnostic detects the cache error, it asks if you have replaced the CPU card. i *lied to it* and said that I had, so when it asked if i wanted to keep the cache disabled, i said "N".

Tube🍂Time replied to Tube🍂Time

aaaand that fixed it! we're now booting to DOS off my DBA-ESDI disk replacement.

Tube🍂Time replied to Tube🍂Time

so here's what i think happened:
1. my early version of the FPGA code had a typo that caused the BURST# line to be held low
2. this caused the DMA controller to get stuck and time out during the cache test, presumably a very early CPU test that checks for cache coherency.
3. this error is *sticky* and gets written to some nonvolatile memory (perhaps not CMOS since i couldn't clear it by pulling the battery.)

Tube🍂Time replied to Tube🍂Time

this is all very good because i know the root cause and it's not something terrible like data bus contention, and it's thankfully not permanent damage.

Vlad Vukicevic replied to Tube🍂Time

@tubetime "No command can not access" so.. uh.. commands can access? 🤯

Tube🍂Time replied to Vlad

@vvuk the document is full of typos and errors.

Vlad Vukicevic replied to Tube🍂Time

@tubetime Your project is an ESDI drive emulator, right? (specific drive type, but ESDI interface) Would it work in another computer that had an ESDI controller and understood the IBM drive?

(I assume so, but then you mentioned microchannel which confused me -- I'm assuming the "creaky old IBM laptop" interface is ESDI?)

Alan Martello replied to Tube🍂Time

@tubetime Your recent posts make me believe you’re a time traveller - perhaps the great-great-grandson of an IBM engineer who as a child found an old notebook complaining about this problem your grandpa just couldn’t solve and that he was fired for and altered the arc of his life. You studied your whole life as an engineer for this moment to come back to today when the hardware was still available, fix the problem, then go back and help your grandpa. Let us know how it turns out.

Tube🍂Time replied to Alan

@amart not too far off! my grandfather worked there. i once reverse engineered a prototype floppy drive he worked on, and got it working again. twitter.com/TubeTimeUS/status/

Steve Syfuhs replied to Tube🍂Time

@tubetime how does that even work? After the first iteration isn't the refresh bit always set, so it's stuck in an infinite loop if it never IRQs?

Tube🍂Time replied to Steve

@SteveSyfuhs oh sorry REFRESH_BIT is a macro that grabs an IO port bit that toggles with the DRAM refresh signal every 15us.

Steve Syfuhs replied to Tube🍂Time

@tubetime ahhhh that makes way more sense now

Netux replied to Tube🍂Time

@tubetime
Ok, I'm a bit confused. You have an fpga you are worthing on, but also a hard drive you are trying to read and another cup you have a white paper for? The drive controller chip?
I looks like you are writing notes for yourself.
I'm guessing you are an EE? Or are you a CE? Us normal CS guys don't ever get to the logic analyzer.

Tube🍂Time replied to Netux

@Netux it's a solid state hard drive replacement that I'm designing. EE but I do some digital stuff too

Go Up