Creating a !BOOT file

bbc/electron apps, languages, utils, educational progs, demos + more
Post Reply
benanderson89
Posts: 20
Joined: Wed Nov 28, 2012 1:09 pm
Contact:

Creating a !BOOT file

Post by benanderson89 » Fri Nov 30, 2012 8:29 am

I've run around the internet like a headless chicken for a while now and have yet to find any instructions on how to create a !BOOT file on disk. The only bit of information I've found states its a bit of machine code. Whether thats true or not is up for debate.

Anyone in the know?

Thanks!

-Ben

User avatar
davidb
Posts: 2902
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: Creating a !BOOT file

Post by davidb » Fri Nov 30, 2012 8:41 am

From memory...

!BOOT files are often just text files. If your DFS has the *BUILD command, you can run this to create the file:

Code: Select all

*BUILD !BOOT
Then write the text to go in the file. Press ESCAPE after writing the last line.

Make the disk bootable by typing:

Code: Select all

*OPT 4,3

User avatar
aerworuld
Posts: 1734
Joined: Tue Sep 25, 2012 9:40 pm
Location: Basingstoke, Hampshire
Contact:

Re: Creating a !BOOT file

Post by aerworuld » Fri Nov 30, 2012 11:21 am

on my elk running ap3 ADFS, i format a new disk using the *EFORM utility and set the boot option to *OPT 4,3 as David said - this causes the system to look for a !BOOT file that can be automatically *EXECed upon <SHIFT><BREAK>

then i just write a simple basic prog such as CHAIN "whatever my actual prog is" and save it as !BOOT on the disk

Stuart :)

benanderson89
Posts: 20
Joined: Wed Nov 28, 2012 1:09 pm
Contact:

Re: Creating a !BOOT file

Post by benanderson89 » Fri Nov 30, 2012 11:48 am

Using Acorn DFS in BeebEm works fine. :)
Hopefully I'll get my real been back this afternoon so I can try and use it on there. I'm not sure what DFS it has as it suffered from magic smoke before I had a chance to fully explore it.

User avatar
sweh
Posts: 2301
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: Creating a !BOOT file

Post by sweh » Fri Nov 30, 2012 6:46 pm

benanderson89 wrote:I've run around the internet like a headless chicken for a while now and have yet to find any instructions on how to create a !BOOT file on disk. The only bit of information I've found states its a bit of machine code. Whether thats true or not is up for debate.

Anyone in the know?

Thanks!

-Ben
BBC floppy "boot" is set with "*OPT4" command:
*OPT 4,0 --> no boot
*OPT 4,1 --> *LOAD !BOOT
*OPT 4,2 --> *RUN !BOOT
*OPT 4,3 --> *EXEC !BOOT

If you use "3" (*EXEC) then !BOOT merely needs to be a text file. This can be built with the *BUILD command
eg
*BUILD !BOOT
CHAIN "MENU
<ESCAPE>
*OPT 4 3

Now when you shift+break with this floppy in the machine will read the !BOOT file and run the commands in it as if you had typed them in; in this case it will then CHAIN "MENU" but you can make it do almost anything you can type in.

(If you had set "2" - *RUN - then the !BOOT file needs to be a binary executable)
Rgds
Stephen

AJW
Posts: 907
Joined: Sun Feb 15, 2004 2:01 pm
Contact:

Re: Creating a !BOOT file

Post by AJW » Mon May 11, 2020 7:11 pm

Is there a way to edit a boot file within BASIC?

User avatar
SimonSideburns
Posts: 576
Joined: Mon Aug 26, 2013 9:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Creating a !BOOT file

Post by SimonSideburns » Mon May 11, 2020 7:27 pm

AJW wrote:
Mon May 11, 2020 7:11 pm
Is there a way to edit a boot file within BASIC?
Not easily, unless you want to use the BASIC OPENIN, OPENUP, CLOSE etc. commands and write yourself a text file editor.

Install a ROM such as VIEW and you can load that to edit your !BOOT file.
Just remember kids, Beeb spelled backwards is Beeb!

User avatar
BeebMaster
Posts: 3730
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Creating a !BOOT file

Post by BeebMaster » Mon May 11, 2020 7:34 pm

On a Master you can use the built-in Editor with *EDIT !BOOT.

To look at the contents of a !Boot text file you can use *TYPE !BOOT and then if it's a short file and some simple changes are needed *BUILD !BOOT will start again from scratch, and you can copy and amend from the saved copy displayed with *TYPE to make a new !Boot.

*APPEND !BOOT will add further lines to the end of the current file.
Image

User avatar
flaxcottage
Posts: 4308
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: Creating a !BOOT file

Post by flaxcottage » Mon May 11, 2020 8:35 pm

One thing to watch out for when EXECing a !BOOT file is that the file is left open when the BASIC program CHAINs. Mostly this will not be an issue unless the program does a lot of data file accessing. BASIC can only have 5 simultaneous files open at one time and will crash due to the !BOOT file still being left open.

CLOSE#0 as the first line of the BASIC program will stop all that nonsense. :)
- John

Image

If this image does not appear correctly, view in a different browser, such as FireFox or Opera.

User avatar
SimonSideburns
Posts: 576
Joined: Mon Aug 26, 2013 9:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Creating a !BOOT file

Post by SimonSideburns » Mon May 11, 2020 8:47 pm

flaxcottage wrote:
Mon May 11, 2020 8:35 pm
One thing to watch out for when EXECing a !BOOT file is that the file is left open when the BASIC program CHAINs. Mostly this will not be an issue unless the program does a lot of data file accessing. BASIC can only have 5 simultaneous files open at one time and will crash due to the !BOOT file still being left open.

CLOSE#0 as the first line of the BASIC program will stop all that nonsense. :)
That's quite logical and a sensible thing to bear in mind, especially if your own program needs a number of files open itself. Easy to forget though so I'm glad it has been mentioned here.
Just remember kids, Beeb spelled backwards is Beeb!

User avatar
SimonSideburns
Posts: 576
Joined: Mon Aug 26, 2013 9:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Creating a !BOOT file

Post by SimonSideburns » Mon May 11, 2020 8:48 pm

aerworuld wrote:
Fri Nov 30, 2012 11:21 am
then i just write a simple basic prog such as CHAIN "whatever my actual prog is" and save it as !BOOT on the disk
No, that wouldn't work. *OPT 4,3 needs a plain text file to execute, in the same way as *EXEC !BOOT would.
Just remember kids, Beeb spelled backwards is Beeb!

julie_m
Posts: 241
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Re: Creating a !BOOT file

Post by julie_m » Thu May 14, 2020 4:21 pm

You can also use something like

Code: Select all

10*SPOOL!BOOT
20PRINT"CHAIN""PROG"""
30*SPOOL
40*OPT4,3
to generate an !BOOT file from BASIC.

User avatar
jgharston
Posts: 4177
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Creating a !BOOT file

Post by jgharston » Thu May 14, 2020 6:17 pm

flaxcottage wrote:
Mon May 11, 2020 8:35 pm
One thing to watch out for when EXECing a !BOOT file is that the file is left open when the BASIC program CHAINs. Mostly this will not be an issue unless the program does a lot of data file accessing. BASIC can only have 5 simultaneous files open at one time and will crash due to the !BOOT file still being left open.
Not true, BASIC will let you open as many files as you want, BASIC imposes *NO* limitations on any filing system, and *NO* application should impose its beliefs of the functionality of the systems it calls. "Ooooo, *I* never call OSWORD 3, therefore I'm going to ban *YOU* from ever calling OSWORD 3."

*DFS* has a maximum of five open files. ADFS has a maximum of eight, NFS five, ANFS 13, TAPE 2, ROMFS 1, HADFS 5, HOSTS 16, IEEEFS 32, ......

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

AJW
Posts: 907
Joined: Sun Feb 15, 2004 2:01 pm
Contact:

Re: Creating a !BOOT file

Post by AJW » Thu May 14, 2020 8:29 pm

julie_m wrote:
Thu May 14, 2020 4:21 pm
You can also use something like

Code: Select all

10*SPOOL!BOOT
20PRINT"CHAIN""PROG"""
30*SPOOL
40*OPT4,3
to generate an !BOOT file from BASIC.
Very good thank you.

Post Reply

Return to “8-bit acorn software: other”