ROM Basic
Hint #2: How to get out MCA-card IDs from IBM BASICA 
Hint #3: How to determine / change FDD-type from BASIC 

From David Beem 
Hi all, 
    I am just going to give the text from the book I am quoting. Tony has already corrected me on one area & I have retracted part of my early statement. This book has been wrong before, but I still think of it as a very good reference (despite my penned changes scattered throughout). It is 
"The Undocumented PC", published by Addison Westley ("Andrew Schulman Programing Series"), the author is Frank Van Gilluwe, the ISBN: 0-201-62277-7. Chapter 7, "Interupt Vector Table", Page 225, INT 18h, "ROM BASIC/Boot Failure" description: 

"When no boot device is found, this interupt is called. Non-IBM systems usually just return a message that a boot floppy is required. On IBM machines this vectors into ROM BASIC. Almost no other manufacturer puts BASIC in the BIOS like IBM. I understand that the original agreement between Microsoft and IBM offered IBM a reduction in royalties if every machine included Microsoft's BASIC in ROM [Tony already corrected me on repeating this statement]. Because of this, every IBM system still has the obsolete ROM BASIC as part of the system BIOS." 

I was just repeating the bad information I had in this case. The INT 18h vector is in low memory at 0:60 - 0:63 (4 bytes) in "Big-Endian" format (byte order reversed). This address can't be simply jumped to & I need to also modify my earlier "BASIC loader" statement: BASIC and BASICA ("A" for Advanced; you could reserve a block of memory with the BASICA loader for an option.) had to set up the system a bit before dropping into BASIC. If the occasion happens where there is no boot device (or on the PS/2s if the boot device isn't configured correctly) the ROM BASIC doesn't have the ability to transfer back to the "SYSTEM" shell. QBASIC may check for ROM BASIC & run it instead if it is found. I thought EDIT and QBASIC were added to DOS in version 5 (At least in MS-DOS). PC-DOS also had a single-line editor until almost the very end that was horrible unless you really knew how to use it. It worked in situations where EDIT and QBASIC didn't though. 

> Hmmm. What machine? 
    Most all IBM's from the lowly 5150 PC to the systems just below the 1991 PS/2s. Maybe we need to get a list going. Fer' sure AFAIK: 

PS/2 Model 25 
PS/2 Model 30 
PS/2 Model 25 286 
PS/2 Model 30 286 
PS/2 Model 50 
PS/2 Model 55SX 
PS/2 Model 60 
PS/2 Model 70 
PS/2 Model 73 (P75 for sure) 
PS/2 Model 80 

Don't know about the: 
PS/2 Model 35SX 
PS/2 Model 40SX 
PS/2 Model L40 
PS/2 Model 56 
PS/2 Model 57 
PS/2 Model 65SX 
PS/2 Model 76 
PS/2 Model 77 
PS/2 Model 85 
PS/2 Model 90 
PS/2 Model 95 

> BTW, somewhere in here is probably an address that can be jmp'ed to from a bootsector, or some similar stunt from a non-protected mode OS Got to be somewhere. You just have to disassemble the BIOS around the 18h code to find where & how. The ROM routine probably is just one-way when there is no boot device present: You're dropped into BASIC w/o a way to SYSTEM out. On PC-DOS 3.3 the BASIC.COM loader is just 1,063 bytes long. The  "Advanced" loader BASICA.COM is quite a bit more at 36,403 bytes. With the BASICx.COM loader you would be able to SYSTEM back to the OS. 
    The INT 18h vector is at 0:0060h - 0:0063h. Does Linux hook the vector in any manner? The system has to be set up before the jump too (I think I remember something about "PUSHF", push flags, at least.).I have just a scattering of information how the ROM BASIC is called. Does someone else know, or has the time to reverse engineer BASIC.COM? I show the first 768 
bytes (out of the 1,063 total, leaving 295 bytes as error messages/working code.) as stack space, so the OS can be returned to with a SYSTEM command. The only error message within is about loading BASICA (I think BASIC & BASICA are wholely independant, but if you specify some particular loader options with BASIC it calls BASICA (& maybe viceversa?). The generic commandlines do the same. BASICA has more to do with more advanced options like reserving memory (i.e. for an Assembly routine), etc. I am unable to find the address to jump to on a cursory glance. I will continue to look. 

Hi all, 
    Now we are having some fun! I have to correct my arithmetic too. I forgot to take the 100h bytes from the COM file header into account & grouped it with the stack space. The stack space should be 02F0h minus 0100h (header) = 512 bytes. 
    The BASIC.COM loader requires BASICA.COM to be present too, so there is much more going on if you want to save files to disk,SYSTEM back to the OS, or almost anything else. You could make it so you drop into ROM BASIC to mimic when a boot device is not present without too much trouble, but you are going to be stuck there until a reboot. The only time I have used it is when you can't boot otherwise & need to type in the BASIC code to find out which MCA adapters are there (Try THIS). 

9595 Main Page