6502 CP/M: 1/14

Поділитися
Вставка
  • Опубліковано 1 жов 2024
  • In whch yr hmbl svt ports Digital Research's seminal 1977 operating system CP/M to the 6502 processor, on camera!
    This is initially aimed at the BBC Micro, simply because it makes development and debugging easy, but it's intended to be portable, with the Commodore 64 as a (very slow) secondary target. Binaries are relocated at load-time so to avoid depending on any particular memory layout; this is necessary due to the much less standardised 6502 memory maps.
    All the code is available on github here: github.com/dav... (but beware of spoilers!)

КОМЕНТАРІ • 21

  • @jumpstar9000
    @jumpstar9000 8 місяців тому +2

    Oh wow, good for you! I did an awful lot with CP/M-80, CP/M-86, MP/M and CCP/M back in the late 70's and early 80's. How incredibly fun you porting it. Super cool!

  • @TSteffi
    @TSteffi 7 місяців тому +1

    Fun fact: CP/M 3 replaced the reader and punch functions with aux functions that also include a status call. So on CP/M 3, there are terminal programs that don't do direct hardware access

  • @chipmonkey7100
    @chipmonkey7100 2 роки тому +3

    Nice to see CP/M make it to the 6502. Back in the day (late 80s) at my first job we worked on both ports to Z80, 8086, and 68000. We also did MP/M for Z80, and that was entertaining. I hope others take up the CP/M 6502 implementation and get some software running on it. Best wishes and thank you for these long form videos. I am always keen to see them and catch the next episode. Great coding!

  • @reinoud6377
    @reinoud6377 Рік тому +1

    What about using the 6502 copro with its 64k?

    • @hjalfi
      @hjalfi  Рік тому

      Yep, works just fine on it and you get a massive 57kB TPA.

  • @Darkstar2342
    @Darkstar2342 2 роки тому +2

    on the C64, you can move the screen RAM around (but only a bit, not arbitrarily) ... 0400h is just the default location

  • @pnadk
    @pnadk 9 місяців тому

    I think most of the missing system calls were added in CP/M 3.

  • @reinoud6377
    @reinoud6377 Рік тому +1

    Or use it as a rom image? Gives an extra 16k

    • @hjalfi
      @hjalfi  Рік тому

      Yes, that would help, but I haven't actually done that. Pre-relocating the BDOS and CCP would require some infrastructure that's not there yet. The other thing which could be done is to extend the TPA on the Master up to 0xc000 by using the sideways RAM.

  •  2 роки тому +1

    This is funny, I have/had similar idea, while writing a software based Z80 emulator for 65xx CPUs (I write "65xx" since 65816 also interests me, and my main focus now is MEGA65), so in theory it can (well, will be able to ...) run original CP/M but emulating Z80 in software is slow. So my idea was to write a CP/M like OS in native 65xx assembly, and use my Z80 emulation code only to run the actual Z80 apps which can interact BDOS/CBIOS written for real natively. So I can have huge amount of already existing CP/M programs to be able to run then, but the emulated nature of CP/M wouldn't make it _very_ slow at least for file operations etc, when time spent in BDOS or BIOS and not executing the user program ... Well, technically 8080 is already enough for more traditional CP/M programs, but anyway, Z80 would be the goal.

    • @hjalfi
      @hjalfi  2 роки тому

      How big is your emulator, so far? The 8080 would probably be fine, as it's got a fairly small number of instructions, but the Z80 is much more complex. I wonder how much memory you'd have left on a normal 6502...

    •  2 роки тому

      @@hjalfi Well, since I don't deal with stock 6502/6510 at the point, it does not matter (I even enjoy to waste memory if it's faster to execute in average!), as both of the CPU of MEGA65 and the 65816 allows addressing memory outside of the current 64K, so I can emulate a 8080/Z80 with full 64K of address space available, not restricted by the code size of the emulator itself. I even plan to have CP/M implementation done in native 65xx asm, which is not in the emulated Z80/8080 address space (sure, some things needs to be there, still, like BIOS and BDOS entry points/vectors, and some tables often used by CP/M programs directly, and so on). But yeah, you're right, on a real 6502 a Z80 emulation can use considerable amount of RAM, so you have less space for the actual Z80 code to play with. And yes for sure, Z80 is much harder to be emulated than a 8080, to be honest, so far, I had only 8080 working, but it could run CP/M MS BASIC (with an absolute minimal CP/M "emulation" to have only console I/O working nothing other). But it is targeted the MEGA65 only.

  • @zzmaj
    @zzmaj Рік тому

    Actually there is cp/m for 6502, based on 8080 Simulator for the 6502 written in 1978 Roßmöller created cp/m emulator that works on c64 :)

  • @GeorgeFoot
    @GeorgeFoot 2 роки тому

    Great work! Maybe one day someone can indeed make some software to run on it ;)

  • @tomavin1687
    @tomavin1687 2 роки тому +1

    What keyboard do you use? Sounds so good

    • @hjalfi
      @hjalfi  2 роки тому

      Unicomp Classic, a modern clone of the IBM Model M.

  • @nunofelicio
    @nunofelicio 2 роки тому

    Great video! , thanks!

  • @UKnew1
    @UKnew1 2 роки тому

    Nice to meet you too 🐬🐬

  • @debrajhansda4280
    @debrajhansda4280 2 роки тому

    Keep up the good work bro, love u

  • @yorgle
    @yorgle 2 роки тому +1

    Awesome! Are C64 Disk images available for it?

    • @hjalfi
      @hjalfi  Рік тому +2

      Not quite yet, as I haven't set up the autobuilder. But it works on the Commander X16 now too.