Shop OBEX P1 Docs P2 Docs Learn Events
ZiCog a Zilog Z80 emulator in 1 Cog - Page 13 — Parallax Forums

ZiCog a Zilog Z80 emulator in 1 Cog

1101113151641

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2009-04-29 23:46
    I will put code in to check the limits of the Ram Disk. It's not like those few instructions (even in spin) will matter compared to the old disk access times.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • YodaYoda Posts: 132
    edited 2009-04-30 00:41
    Heater, Clusso

    Is it possible to get an interim snapshot of code? I would like to help if I can. I am very interested in the disk area (making large hard disks work, etc). I am doing an implementation for the N8VEM and this will definitely help that effort as well. I can see I can pretty easily modify the existing code to make it emulate the N8VEM so I will probably do that along the way as well. I have CPM2 stable and have it connected to a VT100 driver on Blade 1 (I think it is a derivative of oldbitcollectors version that has been enhanced).

    I would love to get my feet wet in this if possible.

    Dave
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-04-30 04:41
    Yoda said...
    I would like to help if I can.
    [noparse][[/noparse]and ...N8VEM...]
    Yes please from me but please check with Heater - It's his Z80 emulator code. Below is the ZiCog/TriBlade Demo code v _rr072 and the new TriBladeProp Blade#2 driver v202. All other code is as posted on the TriBladeProp thread about a week ago.

    I am integrating Heater's latest ZiCog code currently, so meanwhile just use the previous one.

    Also heater has emailed me a new CPM3 disk image so I will convert that and try it today/tomorrow and if it fixes the keyboard bug I will post it.

    We (Heater and I) are trying to keep this thread more for ZiCog (Z80 emulator) and the TriBlade thread more for that implementation·and other goodies. Obviously there is a lot of crossover, but that's our·objective.

    OT: There are a number of TriBlades now running out there now,·so I will be posting some extra featres that may not have been obvious from the schematics and descriptions on the TriBladeProp thread. Mike Green is doing Flash drivers, OBC is likely to be doing PropDos and/or VT100 ??. Any help is most welcome. Anyone want to get Ethernet (ENC28J60) running on Blade #3 (which is pretty much a prop with I/O pinouts only)?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-04-30 04:54
    I'm following this thread actively and will be able to contribute soon (Future Electronics have just emailed me to say the memory chips are on the way).

    I'm not an expert on the ethernet chip but hopefully someone here is. I have learnt quite a few things though in getting an N8VEM board online (routers, portforward, dyndns) so I might be able to contribute something there. Getting these boards online and networking would be pretty cool.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-04-30 05:45
    Dr_A: So you have given up the idea of using the SRAMs in a missile guidance system then? nono.gif· hahaha

    I just posted on the TriBlade thread how we boot PropDos/PropCMD from Eeprom and then run ZiCog from a binary on the microSD card.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm

    Post Edited (Cluso99) : 4/30/2009 5:54:20 AM GMT
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-04-30 20:53
    Hello,

    did anybody introduce help-organisations engaged in afrika to this "low-cost-computer" ?

    Was there a feedback about cases where it REALLY makes sense to use them in afrika ?
    maybe solar-powered in the bush ?

    (I'm asking this as I guess the biggest problems in afrika are still poorness, no water, analphabetism, no basic medical services etc.
    and NOT a lack of computerisation)

    best regards

    Stefan
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-05-01 05:26
    Amazing - the chips from Future Electronics arrived today. That was only 2 working days. Very impressive. Now, once I finish work tonight I might be able to start putting a triblade together. Woot!

    Re low cost computers in Africa, I guess it is a matter of finding an application. For me, the ultimate goal is a network of wireless solar powered computers to monitor wells, bores, tanks, stock troughs and the like. It ought to have applications in remote parts of Australia, and there probably are other parts of the world where it could be useful. The aim is to have something that uses small amounts of current so it can be operated away from mains power, but still be smart enough to handle file transfer, automatic upgrades of software and talking to the internet. And be robust enough not to crash.

    Maybe you could use them as cheap word processors. But judging from all the emails I get from Nigeria, I think there are no problems with access to internet cafe computers...

    Post Edited (Dr_Acula (James Moxham)) : 5/1/2009 5:35:10 AM GMT
  • heaterheater Posts: 3,370
    edited 2009-05-02 22:17
    The ZiCog emulator now supports 8MB Hard Drives on SD card.

    See screenshot.

    I'll post the code tomorrow after I've cleaned it up a bit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
    820 x 725 - 31K
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-05-03 06:11
  • heaterheater Posts: 3,370
    edited 2009-05-03 12:05
    As promised her is zicog_v0_8.

    New in V0.8:
    1) Support for four 8MByte hard disk emulation on SD card (included CP/M BIOS only uses 1)
    2) Fixed a bug in the emulation of the Z80 DJNZ instruction.
    3) Requires the HomeSpun spin compiler to build it.
    4) Includes a Makefile to automate build and download from Linux.
    5) Includes a little program mk_zicog_image.py to make a raw SD card image from SIMH AltairZ80 floppy and hard disk images.

    This release runs on a demo board with SD card attached no external RAM. So only 19K for CP/M.
    As far as I can tell hard disk read/write works OK but CP/M hangs after a write, probably because it does not have enough memory. You cannot normally boot CP/M with a hard drive in less than 20K!! Files copied to drive I: are there intact after a reboot.

    Sorry but this now requires HomeSpun to build unless you want to edit out all the # directives. This is done so that we can support demo board and TriBlade from the same source files.

    The mk_zicog_image.py program takes 8 floppy disk images and up to 4 hard disk images, available from the SIMH AltairZ80 simulator project, processes the sectors into SD card blocks and concatenates them into a single image file for writing to SD card.

    On Linux I use dd to put this image on SD cards:

    dd if=zicog.dsk of=/dev/sdf

    No idea how you would do that in Windows.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-05-03 18:47
    Heater,

    My quip about AVRs having ten incompatable compilers is starting to come true here, too. Hey-Ho

    Any particular flavour of Linux recomended for homespun??
  • BradCBradC Posts: 2,601
    edited 2009-05-03 18:57
    Toby Seckshund said...
    Heater,

    My quip about AVRs having ten incompatable compilers is starting to come true here, too. Hey-Ho

    Any particular flavour of Linux recomended for homespun??

    Anything that supports mono will generally work. I tried it on Ubuntu 8.04 and it fired right up.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "VOOM"?!? Mate, this bird wouldn't "voom" if you put four million volts through it! 'E's bleedin' demised!
  • localrogerlocalroger Posts: 3,451
    edited 2009-05-03 19:28
    @Cluso99, just a reminder that I am working on PropCMD 2.0 which will have a rewritten and much more powerful file layer. You will be able to have multiple open files, access subdirectories, use true wildcards such as a*.dat, manipulate attribute bits, and control file fragmentation (since so many functions require continguous files). I'd say it's at about the 50% mark right now, having just seen light on implementing DIR with full wildcard and attribute support. (This is further along than it sounds because it means my file handle and buffer swapping scheme has to totally work in order to access the directory and FAT.)
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-05-03 19:32
    Thanks I thought I say Ubuntu mentioned way back when, I am downloading the latest now so hopefully ver 9.04 would be ok too.

    Three computers on the go again, she'll soon start complaining!
  • heaterheater Posts: 3,370
    edited 2009-05-03 20:14
    I'm using Debian here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • brietechbrietech Posts: 5
    edited 2009-05-04 01:48
    Do you guys have any documentation on how you modified CP/M to be able to see different disk drives and things? I have an actual Kaypro 2'84 running CP/M 2.2 that I would love to add some extra storage to (possibly via a serial->propeller interface), but I am something of a CP/M novice. I have CP/M up and running fine, and I have Wordstar, MBASIC, SBASIC, and all of the normal utilities running just fine, along with a copy of Kermit so I can transfer files from my main PC, but I really want to learn to do some CP/M hacking so I can extend it a bit (I would love to add 'net access as well!).

    p.s. It also has a TurboROM installed, and I have no capability to burn no ROMs at the moment.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-05-04 02:57
    Heater can probably better answer regarding CPM.

    Here is a link that has quite a bit of info about SIMH and CPM http://www.schorn.ch/cpm/intro.php· It probably has other links to CPM information that you may find helps.

    If your ROM is in a socket, there are RAM chips with Battery backups on top (as part of the chip) which makes substitution of the roms easy. Search Non volatile srams on Digikey.

    Localroger: Thanks for the update.

    Heater has explained how to get the files on the SD card on Unix. In windows, just use windows explorer to copy the files (I published them on the TriBlade thread). I use separate files for each drive, so they can be changed easily. I am also only storing 128 byte sectors whereas SIMH (and heater?) are suing 137 byte sectors where the first 3 and last 6 are not required. I make my files using VB6 from original CPM files.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm

    Post Edited (Cluso99) : 5/4/2009 3:07:01 AM GMT
  • heaterheater Posts: 3,370
    edited 2009-05-04 06:39
    Yoda, glad to here of your interest. The more the merrier. Of course all our code is in a constant state of flux at this time. Hope this latest ZiCog release helps no doubt Cluso will have that ported to TriBlade shortly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-05-04 06:48
    Heater: Here is ZiCog v0.08 updated to co-exist with the TriBladeProp. Found the error stopping me getting up to the latest - there were a number of areas where we need to relinquish the ram bus for other command I/O overlays. This time I have placed and #ifdef TriBldeProp arround them.

    The demo code is not at your latest level yet - you have made a lot of changes for the hard disk roll.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • heaterheater Posts: 3,370
    edited 2009-05-04 07:02
    brietech: I don't think I'm going to be much help advising about modifying CP/M BIOS for Kaypro etc.

    You see what we have done is actually the other way around. We start from the CP/M supplied with the SIMH AltairZ80 project, as Cluso linked to, and then build the hardware emulation in Spin to match it. So we have made very few changes to CP/M. In fact for CP/M 2.2 no changes to the SIMH BIOS are required at all!

    CP/M comes in three modules, CCP command line interpreter, BDOS the basic disk OS, and BIOS. Only the BIOS needs customizing for new hardware. As a minimum you will need the source code for your machines BIOS (they were all different) and all the tools, assembler etc, to rebuild and install CP/M from it. Perhaps Google could turn up the source some where.

    The customization process is described in the CP/M 2.2 PDF MANUAL to be found here
    www.cpm.z80.de/drilib.html

    Downloading and playing with the SIMH AltairZ80 cpm2 emulator may be a good idea as it has source for all the modules to study and can rebuild itself "do syscpm2"

    If you can use a Prop to add your new hardware, say hard disk on SD card, then you have the advantage of not having to try and understand the workings of some mysterious hardware. You can define your own interface.

    Good luck.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2009-05-04 07:28
    Cluso: Where ?

    Do you mean I can back fit your changes for zicog.spin but not zicog_demo.spin?

    I should do that before I start on version 0.9.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2009-05-04 07:39
    I little note about SD card images.

    For the ZiCog demos that I put out there is no FAT file system on the SD cards. This is because I want it to run on a Demo Board without external RAM and there is no room for the FAT code. In order to do this I put CP/M disk images almost directly onto the SD card. What happens is that I take a disk image file in the format used by the SIMH AltairZ80 emulator extract the sectors from it one by one and write each sector to a new SD image which has blocks of 512 bytes. One sector goes to one block with a lot of zeros padding it out. I do this for 8 disk floppy disk images and one 8M hard disk image using the included Python script.

    The resulting 64MB Sd card image is then put on SD card using Unix/Linux "dd" command as shown above.

    On Cluso's TriBlade the FAT file system is used and CP/M disk images are on there as normal files which can be written from Windows. The ZiCog hardware emulator code uses conditional compilation to include one method or the other depending on platform.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2009-05-04 08:27
    Heads up, ZiCog now compiles with the latest bst since BradC added conditional compilation.
    Huge thank you Brad.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2009-05-05 14:22
    Now ZiCog version 0.9:

    Added conditional compilation to select Z80 or 8080 emulation. (#ifdef CPU_Z80/CPU_8080)
    Added PropDemoBoard as a conditional compilation option and checks for missing definitions.
    Moved configuration #defines to zicog_demo so they are all in one place.
    Fixed hard disk reset command.
    Added DPB definition for 720K Super I/O Floppy, for use as RAM disk on TriBlade platform.
    Added some sanity checking on selected HDSK drive, track and sectors.
    Added conditional compilation (#ifdef HEARTBEAT) to enable heartbeat LED flashing from Z80 emulator

    As delivered it is configured to run as an 8080 on a PropDemoBoard, will get to the CP/M A> prompt even without an SD card with CP/M on it.

    Being able to run as 8080 only save 4K HUB space !

    ANOTHER CHANGE OF COMPILER ! Now builds out of the box with the latest BST only. Some #defines must be duplicated in zicog.spin to build with HomeSpun.

    Cluso: Hope I haven't made too many little changes here and there for your TriBlade refit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • BaggersBaggers Posts: 3,019
    edited 2009-05-05 18:16
    is it just me, or is anyone else having trouble getting this update? it downloads 177KB then stays getting the last 1K forever [noparse]:([/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-05 18:22
    Downloaded and unzipped fine for me.
  • BaggersBaggers Posts: 3,019
    edited 2009-05-05 18:31
    it's ok, i've got it now, ( thanks Coley [noparse]:)[/noparse] )

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • heaterheater Posts: 3,370
    edited 2009-05-05 18:34
    Baggers'. I've noticed that progress indicators do that quite a lot. First 90% flashes by last 10% takes 90% of the time (Just like software projects)

    Here in Helsinki they just put digital displays on the tram stops (At huge expense I'm sure) to indicate the ETA of the next tram in minutes. They do it to. Totally pointless.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • BaggersBaggers Posts: 3,019
    edited 2009-05-05 18:37
    yeah, especially the windows progress bar, but seriously, every time I tried, it would get to 99% then just stay there, for 10 mins, I left it the longest, while going to have a cuppa lol [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • heaterheater Posts: 3,370
    edited 2009-05-06 11:57
    I notice a lot more downloads for ZiCog than I would ever expect.
    I'm fascinated to know how many hardy souls have actually got it running?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
Sign In or Register to comment.