Author Topic: booting CP/M from B drive  (Read 2688 times)

0 Members and 1 Guest are viewing this topic.

Offline fano

  • Supporter
  • 6128 Plus
  • *
  • Posts: 835
  • Country: fr
  • Easter Egg Programmer
    • Easter Egg
  • Liked: 278
  • Likes Given: 612
booting CP/M from B drive
« on: 15:44, 07 November 10 »
I am using CP/M format to boot my program but i must admit i am a bit annoyed with boot.
I would like to make my program able to boot on B drive with doing |B before but it does return on A drive.
I tested only on Winape but is there a way to boot on B drive with CPM ? (except program on A drive that boot first , change drive to B and load boot to run it)
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Offline Terje_Norway

  • CPC664
  • ***
  • Posts: 102
  • Country: no
  • Liked: 22
  • Likes Given: 12
Re: booting CP/M from B drive
« Reply #1 on: 16:24, 07 November 10 »
Hi,


You could have a look at "Amstrad Bladet" 10-88 page 30. There I think You'll find the answer to Your question.
The listing is in Danish, but it's very simple.
What it does is as following. It reads the EMS file from the original CPM disc, and saves it as an single file. If I recalls right (several Years since I used it) it could be started right away from drive B:


Have a look at it.


Yours


Terje Grind
Norway


PS Link is below :
http://cpcwiki.eu/imgs/1/15/Amstrad_Bladet8810030.jpg

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
Re: booting CP/M from B drive
« Reply #2 on: 16:27, 07 November 10 »
I am using CP/M format to boot my program but i must admit i am a bit annoyed with boot.
I would like to make my program able to boot on B drive with doing |B before but it does return on A drive.
I tested only on Winape but is there a way to boot on B drive with CPM ? (except program on A drive that boot first , change drive to B and load boot to run it)
As far as I can see, it is hardcoded in the AMSDOS rom to boot from drive A.

Why not just use RUN"DISC, peek the AMSDOS variables to see which drive it is run from and setup your boot program appropiately?

I do this for my games.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline fano

  • Supporter
  • 6128 Plus
  • *
  • Posts: 835
  • Country: fr
  • Easter Egg Programmer
    • Easter Egg
  • Liked: 278
  • Likes Given: 612
Re: booting CP/M from B drive
« Reply #3 on: 17:13, 07 November 10 »
why not just use RUN"DISC, peek the AMSDOS variables to see which drive it is run from and setup your boot program appropiately?
This is simple because i wanted to have the full disk with all usables sectors except the boot one because it may be difficult to fit what i want on a 3" disk.
With Amsdos , you loose at least 4 sectors for cat and 2 for a minimalist loader so already 3K , this is not a lot but sometimes that makes difference.

I must admit too this is because i just finished writting disk generator and the whole loading code FDC code.


Thanks Terje , i'll take a look to this.
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Offline TomEtJerry

  • CPC6128
  • ****
  • Posts: 183
  • Country: fr
  • Liked: 122
  • Likes Given: 0
Re: booting CP/M from B drive
« Reply #4 on: 09:13, 09 November 10 »
Hello,

In your boot loader, just add a sector test routine to detect where your disk is inserted.  That might be enough to detect which drive is in use :-).

T&J/GPA

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
Re: booting CP/M from B drive
« Reply #5 on: 11:27, 09 November 10 »

Are you using a 10 sector per track, 41 track disc? This will give you some more space.
Most drives can read track 40 ok, but some will fail trying to read track 41.

What you could do is to have almost a standard data format for the first track (c1-c5 minimum), then extra sectors of your own.

The only problem is that the disc format detection may not always work, because it may find one of your sectors. (unless you number yours the same as the data format)

On track 0, c1-c4 would be the directory. You can add some dummy directory entries to stop amsdos from writing to the rest of the disc. Then you need a small boot program which fits onto c5/c6. You could use the amsdos sector reading functions to keep it small (although a minimal boot program direct to the fdc doesn't take much code). This then boots the remaining data.

When Amsdos reads data, it skips sectors marked with deleted data, so you *may* be able to tag those you don't want it to read as deleted data. So you may be able to reuse the directory sectors *AND* c6 for your own data.

So you may be able to get away with amsdos only using c1 and c5 ;)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline TomEtJerry

  • CPC6128
  • ****
  • Posts: 183
  • Country: fr
  • Liked: 122
  • Likes Given: 0
Re: booting CP/M from B drive
« Reply #6 on: 13:44, 09 November 10 »
Hello,

In   your boot loader, just add a sector test routine to detect where your   disk is inserted.  That might be enough to detect which drive is in use   :-).

T&J/GPA
 
  Gosh, I have written bullshits yesterday :-(. To me, there is no way to   boot with CPM on a B drive, unless you made a little hardware trick (I   think I have seen that on an old CPC magazine). So, your game will only   be A: compatible :-).

Offline fano

  • Supporter
  • 6128 Plus
  • *
  • Posts: 835
  • Country: fr
  • Easter Egg Programmer
    • Easter Egg
  • Liked: 278
  • Likes Given: 612
Re: booting CP/M from B drive
« Reply #7 on: 16:56, 09 November 10 »
To me, there is no way to   boot with CPM on a B drive, unless you made a little hardware trick (I   think I have seen that on an old CPC magazine). So, your game will only   be A: compatible :-).
Thx i'll take a look that could be usefull.This is not a big issue but this is generaly a problem for people who want to use 3"5 version on a B drive and who have no A/B switch.

Are you using a 10 sector per track, 41 track disc? This will give you some more space.
Most drives can read track 40 ok, but some will fail trying to read track 41.
Yes , i am using 10 sectors per track but only 40 track disc to stay compatible with old 3" drives.As 3"5 can go up to 80 tracks , i'll do an Amsdos version for 3"5.Thanks for your usefull advice.
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1981
  • Likes Given: 4650
Re: booting CP/M from B drive
« Reply #8 on: 23:10, 09 November 10 »
Use the XD-DOS ROM to boot CP/M from drive B (!CPM,1). PM me for CP/M on drive B disc images.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline fano

  • Supporter
  • 6128 Plus
  • *
  • Posts: 835
  • Country: fr
  • Easter Egg Programmer
    • Easter Egg
  • Liked: 278
  • Likes Given: 612
Re: booting CP/M from B drive
« Reply #9 on: 19:55, 10 November 10 »
Use the XD-DOS ROM to boot CP/M from drive B (!CPM,1). PM me for CP/M on drive B disc images.
Thanks , that is good to know but it is for users who will use the disk , not only me.
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1981
  • Likes Given: 4650
Re: booting CP/M from B drive
« Reply #10 on: 21:56, 10 November 10 »
Thanks , that is good to know but it is for users who will use the disk , not only me.

Well, you can become king Fano XVIII and just rule them! ;D Or ... maybe .... if will only run from A.  :(
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline fano

  • Supporter
  • 6128 Plus
  • *
  • Posts: 835
  • Country: fr
  • Easter Egg Programmer
    • Easter Egg
  • Liked: 278
  • Likes Given: 612
Re: booting CP/M from B drive
« Reply #11 on: 22:40, 10 November 10 »
hail to the king baby !  :laugh:

There will be a B: version  ;)
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1981
  • Likes Given: 4650
Re: booting CP/M from B drive
« Reply #12 on: 00:44, 11 November 10 »
hail to the king baby !  :laugh:

There will be a B: version  ;)

Sounds fair to me  :)  Can't wait for your next production to be released  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline HAL 6128

  • 6128 Plus
  • ******
  • Posts: 513
  • Country: de
    • index.php?action=treasury
  • Liked: 253
  • Likes Given: 1329
Re: booting CP/M from B drive
« Reply #13 on: 17:27, 16 May 18 »
...sorry for digging out such an old thread.

I just came up with a quick idea to patch AMSDOS (in WinApe) at that address &C20C with the help of @arnoldemu disassembling of AMSDOS to start CP/M from Drive B:

Disassembling cutout...
Code: [Select]
;;==================================================================
;; boot CPM
...
;; setup IOBYTE
...
;; reset user number/drive number
...
;; load boot sector
c20a 0e41 ld c,$41 ; sector id
c20c 110000 ld de,$0000 ; track 0, drive 0 <=== put an "1" here
...

just put an "1" on address &C20D for drive 1 and CP/M (2.2) will load on Drive B (ok, the configuration sector won't be loaded...)
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX