CPCWiki forum

General Category => Technical Support - Software related => Topic started by: PortoManc on 17:43, 29 September 23

Title: Tryout Operating systems
Post by: PortoManc on 17:43, 29 September 23
I hope this is the correct place to post this thread... If not, please move it to the correct one, please.
I'm beginning to delve a little into Machine code on my recently installed CPC6128 emulators on my Windows 11 PC. I've been digging around and found a stack of PDF books on programming in BASIC, Machine Code, C, etc.
This may be a bit of a silly question, but I'd like to know if it's possible to build my own boot disk for a new Operating System (let's call it 'PJRDOS'). I know we already have AmsDOS and CP/M in various flavours, so most will probably think it's a bit of a pointless exercise, but I'm curious to see if it can be done. I know it's possible on other processor types (eg Intel 8080) to write code to a boot sector on a floppy disk and build up a DOS from there, but those are for PCs. There are a number of disk editors for the Amstrad CPC6128, where we can perhaps write to the boot sector of the disk, and then daisychain into the internals of the OS processes. Has anyone done this before (or even attempted to build an Operating System from scratch for their machine)? And what success did they get?
I know that an Amstrad doesn't simply just 'boot up' by checking the contents of Disk A: as would a PC, by the way, so I would envisage a disk perhaps that would load an RSX (again, let's say something like '|PJR'), and then that would look for the 'system disk' in drive A and continue on...
Feasible? 
Thanks 
Title: Re: Tryout Operating systems
Post by: eto on 18:06, 29 September 23
when you enter |CPM in BASIC it loads and executes the boot sector.
Title: Re: Tryout Operating systems
Post by: PortoManc on 19:22, 29 September 23
Yes, eto, thank you for your reply. I'm aware that |CPM boots up a CP/M disk from a call to memory. But I wondered if that RSX call specifies a particular set of bootstrap instructions (specific track & sector for the disk, unique for a CP/M system disk) which might not be applicable to a non-CP/M disk. So, on the off-chance that that was the case, I suggested a |PJR RSX that would do the same for the PJR-DOS disk.
Title: Re: Tryout Operating systems
Post by: Nich on 21:32, 29 September 23
Quote from: PortoManc on 19:22, 29 September 23But I wondered if that RSX call specifies a particular set of bootstrap instructions (specific track & sector for the disk, unique for a CP/M system disk) which might not be applicable to a non-CP/M disk.
|CPM looks for track 0, sector &41 on the disc in drive A, loads it to address &100 in RAM, and executes it. The standard CP/M format on the CPC uses sectors numbered from &41 to &49 inclusive, but as long as track 0, sector &41 is present, CP/M will load and execute the code/data in that sector.
Title: Re: Tryout Operating systems
Post by: PortoManc on 16:06, 30 September 23
Nich,
That's useful. I was able to create a 'virtual' drive and amend that sector (it only created a blank screen, however, as I edited that sector and added code for a 8086-processor boot sector - yes... I know that is wrong for a Z80 processor, but once I can begin to disassemble the CP/M bootloader and see what I can do with it, then we shall see how successful it might be as a project  :) )
 
Title: Re: Tryout Operating systems
Post by: GUNHED on 13:44, 03 October 23
Instead of going to use the !CPM command to boot from disc there are other ways to get an OS started. (But before I go into this: You can disconnect a wire bridge on the CPCs PCB, then it gets as dump as a 8086 machine and directly starts to boot from disc btw).

For example FutureOS does boot from ROM (well, it actually runs into ROM to save RAM and make it more stable). This is done by RSX command !OS.
But you can also move the ROM A of FutureOS it ROM position 0 - then it get's started as soon as you switch your CPC on.
And you can also use a patched Lower ROM to directly start up FutureOS.

Well, just to show that there are different ways to get startet.  :)
Title: Re: Tryout Operating systems
Post by: BSC on 19:11, 03 October 23
Quote from: GUNHED on 13:44, 03 October 23Instead of going to use the !CPM command to boot from disc there are other ways to get an OS started. (But before I go into this: You can disconnect a wire bridge on the CPCs PCB, then it gets as dump as a 8086 machine and directly starts to boot from disc btw).

For example FutureOS does boot from ROM (well, it actually runs into ROM to save RAM and make it more stable). This is done by RSX command !OS.
But you can also move the ROM A of FutureOS it ROM position 0 - then it get's started as soon as you switch your CPC on.
And you can also use a patched Lower ROM to directly start up FutureOS.

Well, just to show that there are different ways to get startet.  :)
Or just to create another opportunity to mention your "OS"? 
Title: Re: Tryout Operating systems
Post by: PortoManc on 19:17, 03 October 23
Thanks, Gunhed. Actually, because this Amstrad is a 'virtual machine' on my Windows PC, I can't really delve around on the innards of the box. The ROM idea might be useful too, but again, I'd have to write and 'flash' a 'virtual ROM', that I could 'load' into my virtual machine emulator. But your replies ahve given me (and I hope others) some ideas to think about.
 
Title: Re: Tryout Operating systems
Post by: GUNHED on 19:32, 04 October 23
Quote from: BSC on 19:11, 03 October 23
Quote from: GUNHED on 13:44, 03 October 23Instead of going to use the !CPM command to boot from disc there are other ways to get an OS started. (But before I go into this: You can disconnect a wire bridge on the CPCs PCB, then it gets as dump as a 8086 machine and directly starts to boot from disc btw).

For example FutureOS does boot from ROM (well, it actually runs into ROM to save RAM and make it more stable). This is done by RSX command !OS.
But you can also move the ROM A of FutureOS it ROM position 0 - then it get's started as soon as you switch your CPC on.
And you can also use a patched Lower ROM to directly start up FutureOS.

Well, just to show that there are different ways to get startet.  :)
Or just to create another opportunity to mention your "OS"?
Thank you for creating another opportunity for me. So read it... FutureOS rocks! And it loves you! Yes, you too!  :) :) :)
Title: Re: Tryout Operating systems
Post by: GUNHED on 19:35, 04 October 23
Quote from: PortoManc on 19:17, 03 October 23Thanks, Gunhed. Actually, because this Amstrad is a 'virtual machine' on my Windows PC, I can't really delve around on the innards of the box. The ROM idea might be useful too, but again, I'd have to write and 'flash' a 'virtual ROM', that I could 'load' into my virtual machine emulator. But your replies ahve given me (and I hope others) some ideas to think about.
 
Thanks. Most emulators (today) allow to comfortable manage ROMs. Somewhere in the Wiki it's described how to make an own ROM. So called RSX commands can be defined. 
After switching on the CPC you enter !YOURCOMMAND and this will call your routine / program inside the ROM, then come back to the Firmware of the CPC.  :)
Title: Re: Tryout Operating systems
Post by: andycadley on 21:19, 04 October 23
An easier way is to emulate a Plus machine and just build a cartridge file.
Title: Re: Tryout Operating systems
Post by: GUNHED on 16:44, 05 October 23
Indeed, after having a working ROM one can also create a complete Cartridge. In this case one can use up to 512 KB of ROM.
Title: Re: Tryout Operating systems
Post by: Prodatron on 19:30, 05 October 23
Btw, I think the main challenge is creating the OS itself, not how to boot it :D
Powered by SMFPacks Menu Editor Mod