| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
| |
Now we can start enabling the timer interrupt. It doesn't do anything yet,
but keyboard continues to work.
|
|
|
|
| |
Clean up some debug prints.
|
| |
|
|
|
|
|
|
|
| |
https://wiki.osdev.org/ATA_PIO_Mode#IDENTIFY_command recommends the straight-and-narrow
way, but the LBA bit shouldn't matter in drive-select during IDENTIFY command,
according to the ATA 3 spec. And it works in Qemu and bochs. It'll slightly
simplify drive parameter management.
|
| |
|
| |
|
| |
|
|
|
|
| |
Now we only specify addresses where it matters.
|
| |
|
|
|
|
|
|
| |
Tested by inserting a call into the shell, but we can't leave it in because
every test ends up clobbering the disk. So it's now time to think about
a testable interface for the disk.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
See shell/README.md for (extremely klunky) instructions.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
dd if=/dev/zero of=data.img count=20160
echo '(+ 1 1)' |dd of=data.img conv=notrunc
./translate ex2.mu && qemu-system-i386 -hda disk.img -hdb data.img
Compare output with `xxd data.img |head`.
This works because primary and secondary drives on the primary bus share
the same ports. All we have to do is select the right drive by flipping
a bit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Both LBA and CHS coordinates are now working for the primary disk on the
primary bus.
Failure modes I ran into:
- ATA ports are 16-bit values. Using instructions with 8-bit immediates
will yield strange results. (I had to debug this twice because I missed
poll-ata-primary-bus-primary-drive-regular-status-word the first time
around.)
Mu's toolchain has been found out here. bootstrap has good
errors but doesn't support the instructions I need in boot.subx. The
self-hosted phases support the instructions but provide no error-checking.
Might be worth starting to add error-checking as I encounter the need.
In this case, a vote for validating metadata sizes even if we don't
validate that instructions pass in the right metadata sizes.
- Can't poll readiness first thing. Maybe we need to always select the
drive first.
- Reading 8-bit values from a 16-bit port (data port 0x1f0) returns garbage.
Reading 32-bit values however works totally fine; go figure. (Maybe
it won't work on real hardware?)
https://forum.osdev.org/viewtopic.php?t=36415
- Passing in a 0 segment will never return data.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
It was just an experiment.
|
|
|
|
|
|
|
|
|
|
| |
Requires the following commands:
dd if=/dev/zero of=data.img count=20160
./translate life.mu
qemu-system-i386 -hda disk.img -hdb data.img
Before running Qemu, data.img will contain all 0s.
After quitting Qemu, data.img will contain the first 512 bytes of disk.img.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
There's still a few places to clean up surrounded in:
== data
...
== code
|
| |
|
|
|
|
| |
This mutates the expected binary.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
I'm going to explicitly show all reserved data even if I don't use it.
Segment headers are only for padding.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|