News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_fano

booting CP/M from B drive

Started by fano, 14:44, 07 November 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fano

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 !

Terje_Norway

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

arnoldemu

Quote from: fano on 14: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)
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

fano

Quote from: arnoldemu on 15:27, 07 November 10why 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 !

TomEtJerry

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

arnoldemu


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

TomEtJerry

Quote from: TomEtJerry on 08: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

  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 :-).

fano

Quote from: TomEtJerry on 12:44, 09 November 10To 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.

Quote from: arnoldemu on 10: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.
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 !

TFM

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

fano

Quote from: TFM/FS on 22: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.
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 !

TFM

Quote from: fano on 18:55, 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

fano

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 !

TFM

Quote from: fano on 21:40, 10 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

HAL6128

...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...

;;==================================================================
;; 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

Powered by SMFPacks Menu Editor Mod