Parallax Forums
  HomeLog InRegisterCommunity CalendarSearch the ForumHelp
   
Parallax Forums > Public Forums > Propeller Chip > TriBladeProp PCB: Uses 3 Propeller ICs for a Single Board Computer (SBC)  Forum Quick Jump
 
New Topic Post Reply Printable Version
848 posts in this thread.
Viewing Page :
 
[ << Previous Thread | Next Thread >> ] | Show Newest Post First ]

Cluso99
We live onboard



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 2276
 
   Posted 8/15/2009 11:16 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
Maybe you could suture my lacerations ? - self inflicted when I realised I forgot my TriBlade, etc - LOL


Links to other interesting threads:
Back to Top
 

Dr_Acula
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 606
 
   Posted 8/15/2009 11:47 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
Packing instructions when travelling: Toothbrush, toothpaste, shaver, triblade...
Back to Top
 

heater
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Feb 2008
Total Posts : 1832
 
   Posted 8/16/2009 1:36 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Dr_A:

I did add a lot of Spin code for emulating SIMH compatible 8MB Hard drives to zicog_demo a long time ago.

That code emulates the SIMH Direct Memory Access interface with the hard drives.

I have only ever been able to test that code on my PropDemo board so it does not go through any FAT file system. Straight from CP/M to sectors (blocks) on the SD card.

I got as far as confirming that I could DIR the hard drive and "type" text files from it. I could also PIP files in and out of it from a floppy drive. However the PIP would crash when complete. So the sequence was something like:
1) PIP a file from drive A to hard drive.
2) It crashes/hangs
3) Reboot CP/M
4) Type the new file copy from the hard drive. It's there OK.

Possibly PIP hangs because hard drive support really needs more CP/M memory than I have. Or it could be a big in the emulation. But at least it was seen to read and write.

There were some posts about this on the ZiCog thread.

Not sure how far Cluso got with adapting/testing that code to TriBlade with FAT system.

By the way: I just noticed that over on the N8VEM group someone has lashed a Z80 to a Prop and is having trouble with double characters coming out of CP/M to the VGA. That has also been reported for the ZiCog, CP/M, WordStar, VGA combination. I had expected you might be one to see it again.


For me, the past is not over yet.

Back to Top
 

heater
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Feb 2008
Total Posts : 1832
 
   Posted 8/16/2009 1:39 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Oh forgot to mention, you may need a recent CP/M BIOS for getting hard disks to work if you are running the emulation in 8080 mode. There was a bug in the SIMH BIOS CPU detection code that I reported to Peter Schorn which he promptly fixed.


For me, the past is not over yet.

Back to Top
 

Dr_Acula
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 606
 
   Posted 8/16/2009 2:33 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Much rejoicing!!!

Cluso, re that post about 6 back, those files work perfectly with 1 stop bit. I don't know how you did it but, YIPPEE!

hop

Tested with Wordstar - all perfect.
Tested with xmodem - all perfect.

Right, now I guess we need to package that up into a working zip and tidy up all those mods I made along the way. Any chance you could pls re-release this with a few simple mods?

* No need to include my name in the file now this works.
* My baud rate was 38400 but I think most people would prefer 115k so change that.
* Do we go 13,10? Or (here is an idea), add a simple subroutine PUB/PRI CRLF and just call it after each line, and you just modify that one PUB if you only want a 13?
* Change that signon message re the serial settings to 1 stop bit. (it is kind of useful in case someone accidentally turned hardware flow control on or something, at least by searching the source code they would get a clue)
* I got sick of typing 'yes' every time it booted to enable the sd card. I always wanted the sd card. So I disabled that message. Is that ok?
* do a quick search for the term N8VEM for all the instances I added traps for N8VEM I/O calls. Maybe add these to comments in the revision list.
* When I moved over to Kye's code I had to comment out lots of the TV.hex calls. Now there is the PUB PrintHex(value) at the end of the program, maybe uncomment them all so it calls that pub instead. Find with a search for tv.hex.
* in 'out_constat ' I print out the port number rather than the byte. Useful to see what is going on. There seem to be some ^C (&H03) characters going out from time to time, eg just before the A> prompt. Not sure what is creating those. Eventually maybe find what is sending those, or comment out the line printing it (though maybe not yet as it still could be useful)

Hopefully the next series of mods will be done in a bit more structured way (ie, memo to self - make more comments along the way!)
Back to Top
 

Cluso99
We live onboard



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 2276
 
   Posted 8/16/2009 5:19 AM (GMT -8)    Quote This PostAlert An Admin About This Post.

James: Great news - congratulations jumpin

However, that code is what I was using - there was no fix ! It is the FullDuplexSerial with the added calls to make it simulate Kye's calls. But I needed to know that the standard FDX object did not have a bug with stop bits, so thanks for confirming. I think that you switched to Kye's code before you actually fixed the problem in the emulation thereby introducing another bug.

re your comments...

  • would you please resend me your latest code (in case the code I sent you was not your latest) so that I can combine your fixes.
  • v093 had a fix for baudrate so it was set only once.
  • v093 had a fix for the crlf issue in the driver, so only 1 change was required. I will think about a cleaner way to do this.
  • can now change the signon messages and Y reply (#define option)
  • agreed with the other comments also.

I think I need a top level wrapper for the FDX/UART or whatever, so that it will be easy to substitute Serial, Keyboard, TV, etc.


Links to other interesting threads:
Back to Top
 

Dr_Acula
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 606
 
   Posted 8/16/2009 5:58 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Yes, I have about 8 folders now with different versions. Very confusing. Some of the things you sent were added and some were not. The key with Kye's code was to greatly simplify the way bytes were captured and this in turn uncovered the bug talking to CP/M.

Anyway, the good news is that it now seems impossible to break. Stuff just seems to work. So, let's just go with that last code you posted.

What next? The faster sd access (is the current one 100khz?). Or the 8mb drives (maybe heater can help with that 8mb code). All very exciting!
Back to Top
 

Kye
Kwabena Agyeman



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Feb 2008
Total Posts : 619
 
   Posted 8/16/2009 10:13 AM (GMT -8)    Quote This PostAlert An Admin About This Post.

Ah, you guys didn't wait. Here's my next version. I've only tested it with a few 255 byte hex dumps and it seems to work great.

If you can also give it a try that would be great. I think I have fixed the problems. It would be a help to me to know that it works somewhere else.

I spent alot of time getting the receiving and transmiting code perfect and down to the few nano seconds of accuracy. The driver now samples within 4 clocks of the correct time and sends bits out within 8 clocks of the correct time.

I only increased the size by 4 longs. So its 148 longs with 130 longs of var space. Everything I think is operational with the 256 byte in and out buffers.

 


Nyamekye,



File Attachment :
serialEngine.spin   60KB (application/octet-stream)
This file has been downloaded 20 time(s).
Back to Top
 

Kye
Kwabena Agyeman



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Feb 2008
Total Posts : 619
 
   Posted 8/16/2009 10:18 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Wait, heres one with the names changed.
 
Also not that the receive check function allows you to check the last received byte that enters the serial buffers. This is usefull for using the buffers to hold an entered string of characters until some key like enter is hit. Then you can dump the buffer and do what you want with it.


Nyamekye,



File Attachment :
serialEngine.spin   60KB (application/octet-stream)
This file has been downloaded 24 time(s).
Back to Top
 

Dr_Acula
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 606
 
   Posted 8/16/2009 3:15 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
Yes, Cluso rushed off and got a whole lot of things working yesterday. Not sure how he does it! I'll plug in the serial engine code tonight and give it a test run.
Back to Top
 

Cluso99
We live onboard



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 2276
 
   Posted 8/16/2009 8:20 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
James: It was a 5 second mod to add the call names like Kye's. You are reading way too much complexity into all this :p
Granted that Kye's code let you look for the actual problem.
 
Kye: Thanks for your code - it helped solve the real bug of dropping characters.
I think there is a bug in the rxavail call.
 
PUB rxavail '' 3 Stack Longs
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
'' │ Returns the number of characters in the receiver buffer.                                                                 │
'' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
  return ((inputHead - inputTail) & $FF)
 Should be...
PUB rxavail '' 3??? Stack Longs
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
'' │ Returns the number of characters in the receiver buffer.                                                                 │
'' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
  if inputHead >= inputTail
    return ((inputHead - inputTail) & $FF)
  else
    return ((inputHead + $FF - inputTail)) & $FF)
Is it necessary to know the number of received characters in the buffer? If not, then this may be simpler..
PUB rxavail : truefalse
'' Check if byte(s) available
'' returns true (-1) if bytes available
  truefalse := rx_tail <> rx_head
BTW can you use a constant to define the length of the buffers like I did with the recent posting of the modified FDX for James (also pasm needs to use the constant also)
 
CON
  bufsiz = 256 '16              'buffer size (16, 32, 64, 128, 256, 512) must be factor of 2, max is 512
  bufmsk = bufsiz - 1           'buffer mask used for wrap-around ($00F, $01F, $03F, $07F, $0FF, $1FF)
VAR
  byte  rx_buffer[bufsiz]           'transmit and receive buffers
  byte  tx_buffer[bufsiz]
  rx_tail := (rx_tail + 1) & bufmsk  'example of use
Kye, we should probably continue this under your SerialEngine post as there may be input from others. I also have some other ideas for you.
 


Links to other interesting threads:
Back to Top
 

Dr_Acula
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 606
 
   Posted 8/17/2009 12:02 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Ok, using Cluso's 'james' files for the moment:
1) I edited z.bat to this:

homespun024 zicog_demo009_rr092_james2 -b -d -i3 -w
zicog_demo009_rr092_james2.binary
pause

This speeds up the compilation process. Edit the spin in the Prop tool or notepad. Save the file. Run z.bat. Double click on the 'load eeprom'
Shut down the prop tool. Run the terminal program.

2) One nifty thing about the zicog is debugging. I have DRIVE__I.DSK added to the list

#else
  FindDriveBase(0, string("DRIVE__A.DSK"))              'set the SD card drive base(s)   CPM2.2
  FindDriveBase(1, string("DRIVE__B.DSK"))              'set the SD card drive base(s)
  FindDriveBase(2, string("DRIVE__C.DSK"))              'set the SD card drive base(s)
  FindDriveBase(3, string("DRIVE__D.DSK"))              'set the SD card drive base(s)
  FindDriveBase(4, string("DRIVE__E.DSK"))              'set the SD card drive base(s)
  FindDriveBase(5, string("DRIVE__F.DSK"))              'set the SD card drive base(s)
  FindDriveBase(6, string("DRVCPM_2.DSK"))              'set the SD card drive base(s)   CPM2.2
  FindDriveBase(7, string("DRVCPM_3.DSK"))              'set the SD card drive base(s)   CPM3
  FindDriveBase(8, string("DRIVE__I.DSK"))              'set the SD card drive base(s)   8MB   
#endif

Then add some debugging capture to the ports that don't exist yet (two new lines near the bottom to print the port and the byte)


'Handle Z80 IO port reads
  case io_port
    srport:                                      'Altair front panel switches register
      in_srport
    simhport:                                    'SIMH control port
      in_simhport          
    constat:                                     'Console status port.
      in_constat
    condata:                                     'Console data port
      in_condata
    statin:                                      'Altair disk status port
      in_statin
    secpos:                                      'Altair disk sector position port
      in_secpos
    dskread:                                     'Altair disk read port 
      in_dskread
    n8vem_uart_test:                            ' test port $6D
      in_test_n8vem                             ' is a byte ready returns 0 for no byte, 1 for a byte
    n8vem_uart_in:                              ' ask for input from port $68
      in_uart_n8vem                             ' get the byte
#ifdef hdskenable
    hdskport:
      in_hdskport                                'SIMH style hard disk port
#endif
    other:
      UART.transmitCharacters(string("Read from unimplemented I/O Port &H"))
      printhex(io_port)
      UART.transmitCharacters(string(" with byte &H"))
      printhex(io_data)
      UART.transmitCharacters(string(13,10))
      io_data := 0
  io_command := 0         

and

PRI on_output
'Handle Z80 IO port writes
  case io_port
    ledport:                                     'An 8 bit parallel output with LEDs attached
      out_ledport          
    simhport:                                    'SIMH control port
      out_simhport
    condata:                                     'Console data port
      out_condata
    constat:                                     'Console status port
      out_constat
    punstat:
      out_punstat                                'Punch control port
    selout:                                      'Altair disk controller select port
      out_selout
    dskcon:                                      'Altair disk function port
      out_dskcon
    dskwrit:                                     'Altair disk write port
      out_dskwrit
    n8vem_uart_out:                              ' &H68                                            
      out_n8vem_byte
#ifdef hdskenable
    hdskport:
      out_hdskport                               'SIMH style hard disk port
#endif
    other:
      UART.transmitCharacters(string("Write to unimplemented I/O Port &H"))
      printhex(io_port)     ' print the port number for debugging
      UART.transmitCharacters(string(" with byte &H"))
      printhex(io_data)
      UART.transmitCharacters(string(13,10))
  io_command := 0                                 'Set flag ready for next io



And now try to get into drive I. It prints out the following:


Write to unimplemented I/O Port &HFD with byte &H02
Write to unimplemented I/O Port &HFD with byte &H00
Write to unimplemented I/O Port &HFD with byte &H00
Write to unimplemented I/O Port &HFD with byte &H06
Write to unimplemented I/O Port &HFD with byte &H00
Write to unimplemented I/O Port &HFD with byte &H39
Write to unimplemented I/O Port &HFD with byte &HF7
Read from unimplemented I/O Port &HFD with byte &HF7
Write to unimplemented I/O Port &HFD with byte &H02
Write to unimplemented I/O Port &HFD with byte &H00
Write to unimplemented I/O Port &HFD with byte &H01
Write to unimplemented I/O Port &HFD with byte &H06
Write to unimplemented I/O Port &HFD with byte &H00
Write to unimplemented I/O Port &HFD with byte &H39
Write to unimplemented I/O Port &HFD with byte &HF7
Read from unimplemented I/O Port &HFD with byte &HF7
Write to unimplemented I/O Port &HFD with byte &H02
Write to unimplemented I/O Port &HFD with byte &H00
Write to unimplemented I/O Port &HFD with byte &H02
Write to unimplemented I/O Port &HFD with byte &H06
Write to unimplemented I/O Port &HFD with byte &H00
Write to unimplemented I/O Port &HFD with byte &H39
Write to unimplemented I/O Port &HFD with byte &HF7
Read from unimplemented I/O Port &HFD with byte &HF7
Write to unimplemented I/O Port &HFD with byte &H02

etc

Then tried uncommenting this line
#define hdskenable 'Uncomment for hard disk support
and added this line

PRI in_hdskport_read | r
'Handle read from hdskport during a disk read command
'This read triggers the actual disk sector transfere
'and must return an error code.
'N.B. sectors are mapped to blocks 1 to 1
  UART.transmitCharacters(string("hdisk read "))

and it then gets to hdisk read.

But further down

PRI in_hdskport_write
'Handle read from hdskport during a disk write command
'This read triggers the actual disk sector transfere
'and must return an error code.
'N.B. sectors are mapped to blocks 1 to 1
  if hdsk_check_dts                                 'Check drive, track and sector are sane
    io_data := $FF                                  'Return error if not
    return
#ifdef TriBladeProp
  '???
#else


Not sure what the '??? means, at this point I'm stuck. Any help would be most appreciated.

Post Edited (Dr_Acula) : 8/17/2009 8:15:47 AM GMT

Back to Top
 

Cluso99
We live onboard



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 2276
 
   Posted 8/17/2009 12:39 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Sorry James... this is over to heater as I didn't know what to do.

But, do we really require hard disks (hence code complexity) if we can up the floppies size to 8MB (or indeed 32MB if we up the sectorsize to 512B)??? There is really no difference between floppies and hard drives as they are all being emulated on the one SD card anyway. That was one objective in choosing the fixed size of 32MB. So 8x32MB=256MB which should be fine for CPM, and remember, we can always add a routine to remount (remap) a floppy to a different file anyway.

Next thing James is to get the bst compiler running - no code changes required. It has the editor and downloader inbuilt plus a teminal program to boot! However, I cannot get bst to recognise my USB port under Vista. It will archive everything too. If you have an issue with the font, download and install the latest PropTool 1.2.6 which fixes it.

I have been looking at the SD drivers this afternoon.


Links to other interesting threads:
Back to Top
 

Dr_Acula
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 606
 
   Posted 8/17/2009 1:45 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
But, do we really require hard disks (hence code complexity) if we can up the floppies size to 8MB (or indeed 32MB if we up the sectorsize to 512B)??? There is really no difference between floppies and hard drives as they are all being emulated on the one SD card anyway

Ah, so floppies can go to 8mb? How do you do that? I'm getting only 984k (see at the bottom) - is that right?

A>dirx

Name    Ext Bytes   Name    Ext Bytes   Name    Ext Bytes   Name    Ext Bytes
ASM     COM    8K ! EXZ80ALLCOM   12K ! SBASIC  COM   26K ! UNERA   COM    2K
BASICLIBREL   42K ! EXZ80DOCCOM   12K ! SHOWSEC COM    4K ! UNLOAD  COM    2K
BOOT    COM    2K ! FORMAT  COM    2K ! SID     COM    8K ! USERLIB REL    2K
BOOTGEN COM    2K ! HALT    COM    2K ! SPEED   COM    2K ! USQ     COM    2K
CCPZ    TXT   40K ! HDIR    COM    2K ! STAT    COM    6K ! W       COM    4K
CONIN   ASM    2K ! L80     COM   12K ! SUBMIT  COM    2K ! WS      COM    8K
COPY    COM    2K ! LOAD    COM    2K ! SUPERSUBCOM    4K ! WS      OVR   52K
CPU     COM    2K ! M80     COM   20K ! SURVEY  COM    2K ! WSMSGS  OVR   14K
DD      TXT    2K ! MBASIC  COM   24K ! SYSCOPY COM    2K ! XFORMAT COM    4K
DDT     COM    6K ! NEW     BAS    2K ! SYSCPM2 SUB    2K ! XMODEMP COM    4K
DDTZ    COM   10K ! NEW     COM    4K ! SYSCPM2ZSUB    2K ! XMODEMQ COM    4K
DIR     TXT    2K ! OVERLAYBCOM    8K ! TEST    BAK    2K ! XSUB    COM    2K
DIRX    COM    4K ! PACMAN95COM   18K ! TEST    TXT    2K ! ZASM    SUB    2K
DUMP    COM    2K ! PIP     COM    8K ! TIMER   COM    2K ! ZSID    COM   10K
ED      COM    8K ! R       COM    4K ! TS      SUB    2K ! ZTRAN4  COM    4K
EX8080  COM   12K ! RSETSIMHCOM    2K ! UNCR    COM    8K
63 File(s), occupying 472K of 984K total capacity
182 directory entries and 512K bytes remain on A:
A>
Back to Top
 

heater
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Feb 2008
Total Posts : 1832
 
   Posted 8/17/2009 1:50 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Dr_A: Your hard disk investigations look good so far. I will try very hard to have a few hours free to help with this this evening (7 hours away here)
I have to remind myself how it was all supposed to work!

Cluso: I think we should stick to the idea of having the 8 SIMH compatible floppy disks and up to 4 SIMH compatible hard disks. Because then:

1) We don't need to create and maintain a customized BIOS to create new sizes of floppy disks
2) All disks can be compatible with SIMH, just drop them into ZiCog and they work.
3) The SIMH hard drives use DMA rather than fetching individual bytes. Should be faster. Floppies do not unless we change the BIOS (See 1)
4) The SIMH style hard drives can be customised (size, geometry) on the fly in Spin with no CP/M BIOS hacking. Just change the disk parameter table.
5) RAM disk should be hard drives and use the disk parameter table for definition.
6) All the code is in place already and most of it has been shown to work already.

Think that's about it:)


For me, the past is not over yet.

Back to Top
 

heater
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Feb 2008
Total Posts : 1832
 
   Posted 8/17/2009 1:54 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Dr_A: Making the floppies bigger requires changes to the CBIOSX.
I'd rather not get into that. I'd like to be able to run all the SIMH CP/M with no or as few changes as possible.


For me, the past is not over yet.

Back to Top
 

Cluso99
We live onboard



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 2276
 
   Posted 8/17/2009 1:59 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
James: I think that size comes from the floppy size on the SIMH disk. You could try a format of one of the blank drives an see what that gives (I have done this before).

Heater: OK sounds great. We should therefore set the sector size to 512Bytes. Does 4x32MB drives sound good or do you want them bigger ??


Links to other interesting threads:
Back to Top
 

heater
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Feb 2008
Total Posts : 1832
 
   Posted 8/17/2009 2:07 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Yes, for hard disks sector size should match the SD block size to make best use of the SD card and the virtual DMA for speed.

If I remember correctly 32M is the limit for CP/M 2 but we can go much bigger for CP/M 3.
What I have been fishing for is a CP/M guru is knows how to tweak the disk parameter tables to do this.
Not to mention suitable params for a RAM disk.

If we can't find a guru it's back to studying the CP/M customization manuals....


For me, the past is not over yet.

Back to Top
 

Cluso99
We live onboard



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 2276
 
   Posted 8/17/2009 2:11 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
OK, lets limit it to 32MB disks. They are done already and the same will work for CPM2 & 3

I am not sure about virtual DMA. Remember, the sram is shared with the SD card so we cannot actually implement this as it will be way too slow!!!


Links to other interesting threads:
Back to Top
 

Dr_Acula
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 606
 
   Posted 8/17/2009 2:33 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
I tried creating a blank 32mb file (=8mb drive) which makes DRIVE__Z.CPM in the vb6 program and then renamed it DRIVE__B.DSK
but it still comes up as less than a mb.

Attached is the little DIRX program as this gives the space used and the space left and the directory. Sort of a combination of stat and dir

Then I read heaters comment. Does that mean drives A-H are 1mb and I, J, K L are 8mb each?

I see a parameter in the spin code that limits the number of drives to 8 - is that relevant?

'The following taken from SIMH Altair simulator CBIOSX.MAC
ndisks = 8 ' total number of Altair disks

The N8VEM parameter blocks seem different - not sure if this will be relevant or not but these are the parameter blocks for the 448k ram disk
1mb rom disk, 8mb hard disk and a 1mb hard disk. But perhaps stick with the simh ones


DPBLK0:                ; DISK PARAMETER BLOCK (ROMDISK 32KB WITH 16 2K TRACKS, 22K usable)
SPT_0:    .DW  16            ; 16 SECTORS OF 128 BYTES PER 2K TRACK
BSH_0:    .DB  3            ; BLOCK SHIFT FACTOR (SIZE OF ALLOCATION BLOCK)
BLM_0:    .DB  7            ; PART OF THE ALLOCATION BLOCK SIZE MATH
EXM_0:    .DB  0            ; DEFINES SIZE OF EXTENT (DIRECTORY INFO)
DSM_0:    .DW  31            ; BLOCKSIZE [1024] * NUMBER OF BLOCKS + 1 = DRIVE SIZE
DRM_0:    .DW  31            ; NUMBER OF DIRECTORY ENTRIES
AL0_0:    .DB  10000000        ; BIT MAP OF SPACE ALLOCATED TO DIRECTORY
AL1_0:    .DB  00000000        ; DIRECTORY CAN HAVE UP TO 16 BLOCKS ALLOCATED
CKS_0:    .DW  0            ; SIZE OF DIRECTORY CHECK [0 IF NON REMOVEABLE]
OFF_0:    .DW  5            ; FIRST 5 TRACKS TRACKS RESERVED (10K FOR SYSTEM)
                ; SYSTEM IS ROM LOADER, CCP, BDOS, CBIOS, AND MONITOR
                ; 
                ; IMPORTANT NOTE: TRACKS $00 - $04 OF 2K BYTES
                ; EACH ARE MARKED WITH THE OFF_0 SET TO 5 AS 
                ; SYSTEM TRACKS. USABLE ROM DRIVE SPACE
                ; STARTING AFTER THE FIFTH TRACK (IE, TRACK $05)
                ; MOST LIKELY FIX TO THIS IS PLACING A DUMMY
                ; FIRST 10K ROM CONTAINS THE ROM LOADER, MONITOR,
                ; CCP, BDOS, BIOS, ETC (5 TRACKS * 2K EACH)

DPBLK1:                ; DISK PARAMETER BLOCK (RAMDISK 512K, 448K usable)
SPT_1:    .DW  256        ; 256 SECTORS OF 128 BYTES PER 32K TRACK
BSH_1:    .DB  4            ; BLOCK SHIFT FACTOR (SIZE OF ALLOCATION BLOCK)
BLM_1:    .DB  15            ; PART OF THE ALLOCATION BLOCK SIZE MATH
EXM_1:    .DB  1            ; DEFINES SIZE OF EXTENT (DIRECTORY INFO)
DSM_1:    .DW  225        ; BLOCKSIZE [2048] * NUMBER OF BLOCKS + 1 = DRIVE SIZE
DRM_1:    .DW  255        ; NUMBER OF DIRECTORY ENTRIES
AL0_1:    .DB  11110000        ; BIT MAP OF SPACE ALLOCATED TO DIRECTORY
AL1_1:    .DB  00000000        ; DIRECTORY CAN HAVE UP TO 16 BLOCKS ALLOCATED
CKS_1:    .DW  0            ; SIZE OF DIRECTORY CHECK [0 IF NON REMOVEABLE]
OFF_1:    .DW  1            ; 1 TRACK RESERVED [FIRST 32K OF RAM]

DPBLK2:                ; DISK PARAMETER BLOCK (IDE HARD DISK 8MB)
SPT_2:    .DW  256        ; 256 SECTORS OF 128 BYTES PER 32K TRACK
BSH_2:    .DB  5            ; BLOCK SHIFT FACTOR (SIZE OF ALLOCATION BLOCK)
BLM_2:    .DB  31            ; PART OF THE ALLOCATION BLOCK SIZE MATH
EXM_2:    .DB  1            ; DEFINES SIZE OF EXTENT (DIRECTORY INFO)
DSM_2:    .DW  2017        ; BLOCKSIZE [4096] * NUMBER OF BLOCKS + 1 = DRIVE SIZE
                ; HD PARTITION 2 IS 16128 SECTORS LONG
                ; AT 512 BYTES EACH WHICH IS 
                ; 2016 BLOCKS AT 4096 BYTES A PIECE.
DRM_2:    .DW  511        ; NUMBER OF DIRECTORY ENTRIES
AL0_2:    .DB  11110000        ; BIT MAP OF SPACE ALLOCATED TO DIRECTORY
AL1_2:    .DB  00000000        ; DIRECTORY CAN HAVE UP TO 16 BLOCKS ALLOCATED
CKS_2:    .DW  0            ; SIZE OF DIRECTORY CHECK [0 IF NON REMOVEABLE]
OFF_2:    .DW  1            ; 1 TRACK (32K) RESERVED FOR SYSTEM

DPBLK3:                ; DISK PARAMETER BLOCK (IDE HARD DISK 8MB)
SPT_3:    .DW  256        ; 256 SECTORS OF 128 BYTES PER 32K TRACK
BSH_3:    .DB  5            ; BLOCK SHIFT FACTOR (SIZE OF ALLOCATION BLOCK)
BLM_3:    .DB  31            ; PART OF THE ALLOCATION BLOCK SIZE MATH
EXM_3:    .DB  1            ; DEFINES SIZE OF EXTENT (DIRECTORY INFO)
DSM_3:    .DW  2017        ; BLOCKSIZE [4096] * NUMBER OF BLOCKS + 1 = DRIVE SIZE
                ; HD PARTITION 3 IS 16128 SECTORS LONG
                ; AT 512 BYTES EACH WHICH IS 
                ; 2016 BLOCKS AT 4096 BYTES A PIECE.
DRM_3:    .DW  511        ; NUMBER OF DIRECTORY ENTRIES
AL0_3:    .DB  11110000        ; BIT MAP OF SPACE ALLOCATED TO DIRECTORY
AL1_3:    .DB  00000000        ; DIRECTORY CAN HAVE UP TO 16 BLOCKS ALLOCATED
CKS_3:    .DW  0            ; SIZE OF DIRECTORY CHECK [0 IF NON REMOVEABLE]
OFF_3:    .DW  1            ; 1 TRACK (32K) RESERVED FOR SYSTEM

DPBLK4:                ; DISK PARAMETER BLOCK (IDE HARD DISK 1024K)
SPT_4:    .DW  256        ; 256 SECTORS OF 128 BYTES PER 32K TRACK
BSH_4:    .DB  4            ; BLOCK SHIFT FACTOR (SIZE OF ALLOCATION BLOCK)
BLM_4:    .DB  15            ; PART OF THE ALLOCATION BLOCK SIZE MATH
EXM_4:    .DB  0            ; DEFINES SIZE OF EXTENT (DIRECTORY INFO)
DSM_4:    .DW  497        ; BLOCKSIZE [2048] * NUMBER OF BLOCKS + 1 = DRIVE SIZE
                ; HD PARTITION 4 IS 4032 SECTORS LONG
                ; AT 512 BYTES EACH WHICH IS 
                ; 1008 BLOCKS AT 2048 BYTES A PIECE.
                ; NOT USING ALL OF THE AVAILABLE SECTORS SINCE THIS
                ; DRIVE IS INTENDED TO EMULATE A ROM DRIVE AND COPIED
                ; INTO A ROM IN THE FUTURE.
DRM_4:    .DW  255        ; NUMBER OF DIRECTORY ENTRIES
AL0_4:    .DB  11110000        ; BIT MAP OF SPACE ALLOCATED TO DIRECTORY
AL1_4:    .DB  00000000        ; DIRECTORY CAN HAVE UP TO 16 BLOCKS ALLOCATED
CKS_4:    .DW  0            ; SIZE OF DIRECTORY CHECK [0 IF NON REMOVEABLE]
OFF_4:    .DW  1            ; 1 TRACK RESERVED [FIRST 32K OF PARTITION]


This is my altair simh 'super cp/m computer' that I use for testing. Seems the same one as for the zicog. Drive I is correctly reporting 8mb with dirx. Just need to find the block parameters and port that over to the zicog??


d tracks[0-7] 254
attach dsk cpm2.dsk
attach dsk1 basic.dsk
attach dsk2 games.dsk
attach dsk3 sbasic.dsk
attach dsk4 supercalc.dsk
attach dsk5 tools.dsk
attach dsk6 wordstar.dsk
attach hdsk i.dsk
set cpu 64k
set cpu noitrap
set cpu z80
set cpu altairrom
set cpu nonbanked
reset cpu
set sio ansi
set sio nosleep
boot dsk
bye


and a printout of it running:


C:\N8VEM\AltairSIMH>altairz80 all

Altair 8800 (Z80) simulator V3.7-3 build 1016 (scp created Apr 20 2008 at 13:01:
09 with gcc 4.2.3)

64K CP/M Version 2.2 (SIMH ALTAIR 8800, BIOS V1.25, 2 HD, 15-Jan-07)

A>dirx
Name    Ext Bytes   Name    Ext Bytes   Name    Ext Bytes   Name    Ext Bytes
ASM     COM    8K ! EXZ80DOCCOM   12K ! SID     COM    8K ! UNLOAD  COM    2K
BOOT    COM    2K ! FORMAT  COM    2K ! SPEED   COM    2K ! USQ     COM    2K
BOOTGEN COM    2K ! HALT    COM    2K ! STAT    COM    6K ! W       COM    4K
CCPZ    TXT   40K ! HDIR    COM    2K ! SUBMIT  COM    2K ! WS      COM    8K
COPY    COM    2K ! L80     COM   12K ! SUPERSUBCOM    4K ! WS      OVR   52K
CPU     COM    2K ! LOAD    COM    2K ! SURVEY  COM    2K ! WSMSGS  OVR   14K
DDT     COM    6K ! M80     COM   20K ! SYSCOPY COM    2K ! XFORMAT COM    4K
DDTZ    COM   10K ! MBASIC  COM   24K ! SYSCPM2 SUB    2K ! XSUB    COM    2K
DIRX    COM    4K ! PACMAN95COM   18K ! SYSCPM2ZSUB    2K ! ZASM    SUB    2K
DUMP    COM    2K ! PIP     COM    8K ! TIMER   COM    2K ! ZSID    COM   10K
ED      COM    8K ! R       COM    4K ! TS      SUB    2K ! ZTRAN4  COM    4K
EX8080  COM   12K ! RSETSIMHCOM    2K ! UNCR    COM    8K
EXZ80ALLCOM   12K ! SHOWSEC COM    4K ! UNERA   COM    2K
50 File(s), occupying 370K of 984K total capacity
198 directory entries and 614K bytes remain on A:
A>i:
I>dirx
Name    Ext Bytes   Name    Ext Bytes   Name    Ext Bytes   Name    Ext Bytes
CP409DOCARK   68K ! K1KERM11LBR   16K ! ZORK1   COM   12K ! ZORK2   DAT   92K
CP411HEXARK  156K ! LU      COM   20K ! ZORK1   DAT   84K ! ZORK3   COM   12K
CP411SRCARK  436K ! UNARC   COM    8K ! ZORK2   COM   12K ! ZORK3   DAT   92K
12 File(s), occupying 1008K of 8136K total capacity
987 directory entries and 7128K bytes remain on I:
I>


File Attachment :
DIRX.zip   2KB (application/zip)
This file has been downloaded 18 time(s).
Back to Top
 

heater
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Feb 2008
Total Posts : 1832
 
   Posted 8/17/2009 3:38 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Cluso:

I think 32Mb hard drives will be fine at least for now, perhaps forever,
we don't have to hack any CP/M driver parameters to do that.

We already discussed the "Virtual DMA" for hard drives, as usual I will have to try to remind my self of what we concluded:)
Thing is for floppy drives each byte in/out goes through a Z80 IN/OUT opcode emulation and hence through all the
Spin code that traps and performs that so even when the the complete sector buffer is sitting in HUB (which it is anyway) that is a lot of overhead.
I would think that there must be away to blit the entire sector buffer from HUB to CP/M space in external RAM in one hit whilst the actual Z80 emulation is
stopped waiting for completion. In fact I though you had already attempted to do that. I will have to look again.

Dr_A:

We can't just make the floppies bigger with bigger image files. The floppy geometry is fixed in the CBIOS.
The SIMHH BIOS can be built with a configurable number of floppies, can save CP/M memory by using fewer. Max is 8 so that is what is in the Spin emulation.

For drive I and up SIMH has totally different driver code in the BIOS. For floppies it is Altair floppy compatible. For hard drives it has variable size/geometry disks
where the geometry descriptor blocks are fetched by the CBIOS from the hd emulator at run time. So to change hd disk size/geometry it is a Spin cnage

When you say "Drive I is correctly reporting 8mb with dirx. Just need to find the block parameters and port that over to the zicog?? "
That is correct and it is ALREADY in the ZiCog spin code.

Don't forget I have been aiming for SIMH compatibility all along.

I try and have more time for this later today.


For me, the past is not over yet.

Back to Top
 

Cluso99
We live onboard



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 2276
 
   Posted 8/17/2009 4:03 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
James: Here is v094. Could you please check it before I post at the top of this thread.(it is untested)
 
You will need to uncomment the #define CPU_Z80 line in ZiCog009_rr090 (bst would not otherwise zip the project).
I have added  #define addLF which outputs a LF following CR in the FDX object (new mode).
 
If all is ok, please uncomment the 4 lines from ZiCog009_demo_rr094 before the #endif as shown (careful of indents)
PRI WriteSRAMblock | i, r, mask, in
  r := tbp2.start
  check_error(r)
#ifdef diskboot
  'clears ram $0000-$EFFF, loads $FF00-$FFFF, loads sram disk above
  'remember we are reading 8KB blocks, so clear the seven blocks and 8KB-128B of eighth block
  if blockno < 8
    'TV.dec(blockno)
    if blockno == 7
      repeat i from 0 to count-1 -(256)                 'clear below $FF00
        buff[i] := 0                                    'clear the buffer
    else
      repeat i from 0 to count-1
        buff[i] := 0                                    'clear the buffer
      if blockno == 0
        buff[0] := $C3                                  'force jmp to $FF00 (faster)
        buff[1] := $00
        buff[2] := $FF
#endif
 
This should improve the boot speed - causes a direct jump to the disk boot code $FF00
 


Links to other interesting threads:
My cruising website is:  www.bluemagic.biz   MultiBladeProp is: www.bluemagic.biz/cluso.htm



File Attachment :
zicog_demo009_rr094-bst-archive-090817-215332.zip   67KB (application/x-zip-compressed)
This file has been downloaded 19 time(s).
Back to Top
 

Dr_Acula
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 606
 
   Posted 8/17/2009 4:47 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Close but getting a hang after this (doesn't give the A> prompt)


ZiCog v0.009 on the TriBladeProp v0.09x
8 bit, parity=None, 1 stop bit, Flow control=None

Starting disks...
A:DRIVE__A.DSK
B:DRIVE__B.DSK
C:DRIVE__C.DSK
D:DRIVE__D.DSK
E:DRIVE__E.DSK
F:DRIVE__F.DSK
G:DRVCPM_2.DSK
H:DRVCPM_3.DSK
Loading SRAM...
................................................................................
................................................Loaded
Starting TriBladeProp driver ...
 Passed, please wait...
Starting Z80 emulation... Passed, please wait...


64K CP/M Version 2.2 (SIMH ALTAIR 8800, BIOS V1.25, 2 HD, 15-Jan-07)

Unknown console status write with byte &H03


More experiments, random key presses eventually brings up the A> prompt but none of the characters are echoed.

More more experiments, going back to the serial object v002, that gets to the A prompt but the characters on the keyboard are coming back as different characters eg i came back as a u.

What changed from this version (see attached)

Post Edited (Dr_Acula) : 8/17/2009 1:08:41 PM GMT



File Attachment :
James_17Aug.zip   1.89Mb (application/zip)
This file has been downloaded 20 time(s).
Back to Top
 

Cluso99
We live onboard



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 2276
 
   Posted 8/17/2009 5:46 AM (GMT -8)    Quote This PostAlert An Admin About This Post.

James: Should just have been a tidyup. Have you #define hdskenable uncommented? Hard disk is not working on the TriBlade yet - this could be getting into an incorrectly handled error. Did you have Drive I enabled?

There are a few extra lines you put in for debugging.

Do you have WinDiff ?


Links to other interesting threads:
Back to Top
 

Kye
Kwabena Agyeman



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Feb 2008
Total Posts : 619
 
   Posted 8/17/2009 5:53 AM (GMT -8)    Quote This PostAlert An Admin About This Post.

Ah, not quite cluso. The whole reseaon I used 256 byte buffers is to exploit the fact that a while using a byte head and tail pointer they have automatic wrap arround.

return ((inputHead - inputTail) & $FF)

Is actually the simpliest way to calculate amount of stuff in the FIFO buffer. Great ain't it? It's also more usefull than just know if there is stuff or isn't stuff because it allows you to know the amount in the buffer.

...

Well, unless anyone has any results on my driver working now or not I'll be moving on to other things.

Cluso99 said...
James: It was a 5 second mod to add the call names like Kye's. You are reading way too much complexity into all this :p
Granted that Kye's code let you look for the actual problem.
 
Kye: Thanks for your code - it helped solve the real bug of dropping characters.
I think there is a bug in the rxavail call.
 
PUB rxavail '' 3 Stack Longs
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
'' │ Returns the number of characters in the receiver buffer.                                                                 │
'' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
  return ((inputHead - inputTail) & $FF)
 Should be...
PUB rxavail '' 3??? Stack Longs
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
'' │ Returns the number of characters in the receiver buffer.                                                                 │
'' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
  if inputHead >= inputTail
    return ((inputHead - inputTail) & $FF)
  else
    return ((inputHead + $FF - inputTail)) & $FF)
Is it necessary to know the number of received characters in the buffer? If not, then this may be simpler..
PUB rxavail : truefalse
'' Check if byte(s) available
'' returns true (-1) if bytes available
  truefalse := rx_tail <> rx_head
BTW can you use a constant to define the length of the buffers like I did with the recent posting of the modified FDX for James (also pasm needs to use the constant also)
 
CON
  bufsiz = 256 '16              'buffer size (16, 32, 64, 128, 256, 512) must be factor of 2, max is 512
  bufmsk = bufsiz - 1           'buffer mask used for wrap-around ($00F, $01F, $03F, $07F, $0FF, $1FF)
VAR
  byte  rx_buffer[bufsiz]           'transmit and receive buffers
  byte  tx_buffer[bufsiz]
  rx_tail := (rx_tail + 1) & bufmsk  'example of use
Kye, we should probably continue this under your SerialEngine post as there may be input from others. I also have some other ideas for you.
 


Nyamekye,

Back to Top
 
[ << Previous Thread | Next Thread >> ]
New Topic Post Reply Printable Version
848 posts in this thread.
Viewing Page :
 
 
Forum Information
Currently it is Friday, November 20, 2009 10:32 PM (GMT -8)
There are a total of 393,734 posts in 55,521 threads.
In the last 3 days there were 82 new threads and 702 reply posts. View Active Threads
Who's Online
This forum has 17687 registered members. Please welcome our newest member, mark09.
65 Guest(s), 6 Registered Member(s) are currently online.  Details
JRetSapDoog, Chris Savage (Parallax), mpark, Kye, Sal Ammoniac, micromang