 |
|
 |
| Parallax Forums > Public Forums > Propeller Chip > TriBladeProp PCB: Uses 3 Propeller ICs for a Single Board Computer (SBC) | Forum Quick Jump
|
        |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 8/24/2009 2:00 AM (GMT -8) |   | I've been doing some experiments trying to get it to boot from a hard drive. Was heater working on this too?
Anyway, zicog currently appears to copy DRIVE_1M.DSK into ram. This binary file looks pretty straightforward as it starts with C3 00 F2 00 00 C3 06 E4 00 00 00 00 00 00 00 00
I know it is a bit sad being able to read machine code from hex, but that is a jmp to F200 which makes sense. So, load in an image of 64k of ram, then start executing at the first byte.
So I tried recompiling on the altair simh. This appears to work and drive A is cpm2.dsk. But looking at the binary of the disk, the first line is E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5
So, I'm not sure how the data is stored on the system tracks. Or even where the system tracks are.
The last line of the SYSCPM2.SUB batch file is ; write boot file to reserved tracks, must be last command BOOTGEN CPMBOOT.COM A:
This writes a file to the system tracks. I managed to find the source for this program on the app.dsk
It is written in a language called SPL (simple programming language). This is a bit like C. To my eyes, and in a somewhat circular sort of way, it also looks awfully like Spin.
Anyway, this code contains a tantalising clue as to how the system tracks work
The sectors of a track are read in the following order: first odd sectors, then even sectors in ascending order 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31, 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32 T0[S9 - S32], T1, T2, T3, T4, T5[S1 - S24] 28 + 32+ 32+ 32+ 32+ 28 = 184 sectors = 23552 byte (5C00) loads sectors to 0 .. 5bff and jumps to 0 when done
But I can't quite decode how it works. At the very least, it does not seem to be a 1:1 copy of the memory.
Has zicog got to the stage of booting from a floppy image where the floppy image boot tracks have been modified with BOOTGEN?
And, can I ask who created the DRIVE__1M.DSK?
Floppy and hard drives ?? have the same boot track geometry. (Though hard drives maybe have more space). Would booting off DRIVE__A.DSK, or indeed, DRIVE__I.DSK involve decoding the system track geometry in Spin.
Any help or advice would be appreciated. Or maybe this has already been cracked?
Working through this document at the moment simh.trailing-edge.com/pdf/altairz80_doc.pdf
... found a C3 00 F2 up at 680H. Not sure what it is doing there.
... found info in the simh documentation about the boot rom on page 8 of the above pdf.Post Edited (Dr_Acula) : 8/24/2009 10:12:44 AM GMT | | Back to Top | | |
 |  heater Registered Member

       Date Joined Feb 2008 Total Posts : 1832 | Posted 8/24/2009 3:51 AM (GMT -8) |   | Hi Dr_A,
Yes I have been looking at booting from hard drive. Turns out to be very easy. Yes we have been booting from CP/M laid down by BOOTGEN for a long time.
Here is an experiment you can do on SIMH to convince yourself of how booting from HD works.
1) Fire up SIMH into CP/M 2. Be sure you have "attach hdsk0 i.dsk" in your cpm2 command file first.
2) Rebuild CP/M 2 with "do syscpm2", be sure you first have at least 1 HD configured in CFGCCP.LIB This step ensures you have HD enabled and produces a CPMBOOT.COM file.
3) Format your I drive with "xformat i" (optional)
4) Copy all your useful CP/M commands from A: to I: with "PIP I:=A:*.*"
5) Put CP/M system on the boot tracks of drive I with "BOOTGEN CPMBOOT.COM I:" Actually the I: disk supplied with SIMH already is bootable but this is how to make it so.
6) Exit SIMH and edit your cpm2 command file such that the last line reads "boot hdsk0" instead of "boot dsk" or whatever.
7) Restart your SIMH and BINGO you are booted up from and logged into the I. drive.
Now how do we do this on the TriBlade ?
1) On SIMH assemble the HD boot loader HDSKBOOT.MAC to get HDSKBOOT.COM
2) Like DSKBOOT.COM this needs to be loaded into RAM prior to starting the emulation, we need both DSKBOOT and HDSKBOOT. It should be loaded at 5C00, if I remember correctly. So this HDSKBOOT.COM will need to be inserted into the RAM image file DRIVE_1M.RAM for TriBlade.
3) There is a byte in the DSKBOOT that determines the drive to boot from, I forget its offset now look in DSKBOOT.MAC. This byte will need setting to 8, I believe, to select the I: disk.
4) The I: disk will need to have been BOOTGENed as above.
How does it work?
On start up the Z80 runs through RAM which is full of NOPs (zeros) until it hits the HDSKBOOT code at 5C00. HDSKBOOT runs and finds out the desired boot device from the magic byte within DSKBOOT, which is at FF00. HDSKBOOT then loads CP/M from that hard drive.
There is one catch: The HDSKBOOT as supplied uses some SIMH feature we don't have on TriBlade. Just now i can't remeber what that was. Something to do with it asking the emulation, via the SIMHPORT, if banked memory is enabled. I think ... For me, the past is not over yet. | | Back to Top | | |
     |  heater Registered Member

       Date Joined Feb 2008 Total Posts : 1832 | Posted 8/24/2009 3:01 PM (GMT -8) |   | Just managed to get reading and writing of packed Altair floppies working in ZiCog, 4 sectors per SD block.
Results: Reads seem to go at about the same speed. No measurements just how it feels. Writes are noticeably slower. Disks are one quarter the size, duh.
Whats wrong? Despite all my previous hand waving arguments about consecutive reads/writes benefiting from only having to read/write one SD block for every 4 sectors we have forgotten that CP/M, at least the BIOS, actively works against us.
CP/M has allocation blocks on disk. That is it works with files in chunks of sectors, say 1024 bytes worth, which would be great for ensuring a lot of sequential reads/writes.
BUT in an attempt to optimize the performance of real floppy drives it implements sector skewing. That is when accessing "logical" sectors 0, 1, 2, 3, 4... the BIOS goes to "physical" sectors on disk 01, 18, 03, 20.... or some other scheme. This is an attempt too allow the disk to spin around so that the next logical sector is under the head while the last sector is being processed.
This effort by the BIOS to ensure speedy sequential accesses of course is exactly the opposite of what we need and almost guarantees we never see sequential access to sectors within our SD card blocks.
Damn.
I will now get on with the packed hard disks. Luckily HDs don't use skewing and have large allocation blocks so sequential sector access should be the norm. For me, the past is not over yet. | | Back to Top | | |
 |  Yoda Registered Member

       Date Joined Mar 2009 Total Posts : 61 | Posted 8/24/2009 3:38 PM (GMT -8) |   | Heater:
You can change the skew pretty easily in the CBIOSX. It is discussed in Johnson-Laird. I was thinking we would run into this - you got there before I could tell you.
Dave | | Back to Top | | |
       |  hinv Registered Member
        Date Joined Jan 2007 Total Posts : 487 | Posted 8/25/2009 6:47 AM (GMT -8) |   | Hi Heater,
Since you can emulate a CP/M machine with your ZiCog, How about emulating a TimexSinclair TS1000?
Doug | | Back to Top | | |
   | 848 posts in this thread. Viewing Page : | | Forum Information | Currently it is Friday, November 20, 2009 10:16 PM (GMT -8) There are a total of 393,733 posts in 55,521 threads. In the last 3 days there were 83 new threads and 703 reply posts. View Active Threads
| | Who's Online | This forum has 17687 registered members. Please welcome our newest member, mark09. 54 Guest(s), 4 Registered Member(s) are currently online. Details Zoot, Chris Savage (Parallax), Nick McClick, Highlandtinker |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2009 |
|
|