Page 1 of 1

Creating a !BOOT file

Posted: Fri Nov 30, 2012 8:29 am
by benanderson89
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

Re: Creating a !BOOT file

Posted: Fri Nov 30, 2012 8:41 am
by davidb
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

Re: Creating a !BOOT file

Posted: Fri Nov 30, 2012 11:21 am
by aerworuld
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 :)

Re: Creating a !BOOT file

Posted: Fri Nov 30, 2012 11:48 am
by benanderson89
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.

Re: Creating a !BOOT file

Posted: Fri Nov 30, 2012 6:46 pm
by sweh
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)

Re: Creating a !BOOT file

Posted: Mon May 11, 2020 7:11 pm
by AJW
Is there a way to edit a boot file within BASIC?

Re: Creating a !BOOT file

Posted: Mon May 11, 2020 7:27 pm
by SimonSideburns
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.

Re: Creating a !BOOT file

Posted: Mon May 11, 2020 7:34 pm
by BeebMaster
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.

Re: Creating a !BOOT file

Posted: Mon May 11, 2020 8:35 pm
by flaxcottage
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. :)

Re: Creating a !BOOT file

Posted: Mon May 11, 2020 8:47 pm
by SimonSideburns
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.

Re: Creating a !BOOT file

Posted: Mon May 11, 2020 8:48 pm
by SimonSideburns
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.

Re: Creating a !BOOT file

Posted: Thu May 14, 2020 4:21 pm
by julie_m
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.

Re: Creating a !BOOT file

Posted: Thu May 14, 2020 6:17 pm
by jgharston
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, ......

Re: Creating a !BOOT file

Posted: Thu May 14, 2020 8:29 pm
by AJW
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.