19

I keep reading that when it was first released, there was a variant of the IBM PC model 5150 that had only 16KB of RAM installed. From a hardware perspective, this would clearly work - the 5150 motherboard had sockets for 4 banks of 4116-type DRAM chips, and switches to select RAM size that did go down to 16KB, but from a software perspective I really can't see how this could possibly have worked.

As recently discussed, the PC's BIOS loads boot code at address 0000:7c00 - i.e., at the top of the 32KB section of memory. On a system with only 16KB installed, this clearly won't work, so how could a 16KB system boot? Or was it only possible to use such a system with ROM BASIC?

  • 7
    barely. - was too hard to resist.... – tofro Dec 29 '17 at 12:26
  • 2
    Very, very slowly... – RonJohn Dec 30 '17 at 2:58
  • Not slower than with any other RAM configuration. – Raffzahn Nov 11 '18 at 15:01
  • 2
    Memory does not have to be contiguous. – Thorbjørn Ravn Andersen Nov 12 '18 at 17:54
  • there is also the mirroring effect ... as you can mirror the 16KiB into any space behaving like a multiple copy of itself ... – Spektre Dec 13 '18 at 14:34
24

What Boot Code? With 16 KiB it was pitched against the Apple II or the C64 with BASIC, nothing else. Remember that the PC (!) had a the cassette port? That's the intended mass storage for a 16 KiB system :))

The minimum requirement for floppy use was, as you already guessed, 32 KiB. And oh wonder, DOS can be booted on a 32 KiB machine. Still, not much space would have been left for any application. 48 KiB was a more realistic size for real world applications.

(DOS itself (everything without the shell COMMAND.COM) was about 9 KiB for 1.x, 24 KiB for 2.x, 36 KiB for 3.0 and 46 KiB for 3.3. So minimum RAM to boot would be 32 KiB for 1.x, 48 KiB for 2.x and 64 KiB for 3.0 - after 3.1 a memory expansion board would be needed to boot on a genuine PC.)

  • 2
    If I remember right, the smallest package of an original IBM PC you could buy that included a disk drive had 64kBytes of memory. – tofro Dec 29 '17 at 13:02
  • @tofro You're right. I did put this into the first version, but then checked again. DOS 1 does boot on a 32 KiB machine. And disk controler and drives where also available as later add on, so 32 KiB machines are not impossible. – Raffzahn Dec 29 '17 at 13:07
  • 8
    Probably not clear to younger readers: ROM Basic executes in-place straight from the physical ROM, which is in its own section of the overall address space. It doesn't get copied into RAM. – rackandboneman Jan 2 '18 at 14:19
  • 1
    @Jonathan Well, it wouldn't have been of no good, as the RAM wasn't any faster than the ROM. Keep in mind, we talk 1980s RAM&ROM. Even the final AT339 8 MHz was still 'slow' enough to cope with ROM at full speed - which was also the last model delivered with Cassette (ROM) BASIC. – Raffzahn Nov 11 '18 at 12:35
  • 1
    @Raffzahn: Most certainly - shadow ram was a much later practice, I remember it from the 386 era. I simply didn't want readers to believe that ROM has always executes directly from ROM - although it definitely did in the original IBM 5150. – Jonathan Nov 11 '18 at 14:50
5

The minimal version of IBM PC, also known as cassette version, was shipped with 40KB ROM and 16KB RAM as outlined in IBM 5150 Technical Reference (SECTION I. HARDWARE OVERVIEW in the reference):

The System Board is a large board which fits horizontally in the base of the System Unit and includes the microprocessor, 40KB ROM and 16KB memory. The memory can be expanded in 16KB increments to 64KB. The System Board also includes an enhanced version of the Microsoft BASIC-80 Interpreter without diskette functions. The BASIC Interpreter is included in the ROM. The System Board also permits the attachment of an audio cassette recorder for loading or saving programs and data.

The 40KB ROM is split between IBM Cassette BASIC and BIOS ROM:

The System Board is designed to support both ROM and Read/Write Memory. The System Board contains space for 48K x 8 of ROM or EPROM. Six module sockets are provided, each capable of accepting an 8K x 8 device. Five of the sockets are populated with 40 KB of ROM. This ROM contains the Cassette BASIC interpreter, cassette operating system, Power-on Self-test, I/O drivers, dot patterns for 128 characters inn graphics mode, and a diskette bootstrap loader. The ROM is packaged in 24-pin modules and has an access time of 250 ns and a cycle time of 375 ns.

The 40KB are mapped at the end of SYSTEM MEMORY MAP below 1 MB from F6000 to FFFFF (see 2-24 in the reference). 8KB area from FE000 to FFFFF belongs BIOS program, according to BIOS MEMORY MAP (see Figure 24 in the reference). CASSETTE BASIC INTERPRETER takes 32KB from F6000 to FE000 just below the BIOS.

The 16KB RAM is mapped at the beginning of SYSTEM MEMORY MAP from 0000 to 3FFF.

CPU starts at the reset vector FFFF0 (16 bytes below 1MB) in the BIOS part of the ROM. BIOS performs Power-On Self Tests (including set up of interrupt vectors in the beginning of low memory) and then jumps to BOOT_STRAP routine:

;--- INT 19 -----------------------------
;BOOT STRAP LOADER
;   IF A 5 1/4" DISKETTE DRIVE IS AVAILABLE
;   ON THE SYSTEM, TRACK 0, SECTOR 1 IS READ INTO THE
;   BOOT LOCATION (SEGMENT 0, OFFSET 7C00)
;   AND CONTROL IS TRANSFERRED THERE.
;
;   IF THERE IS NO DISKETTE DRIVE, OR IF THERE IS
;   IS A HARDWARE ERROR CONTROL IS TRANSFERRED
;   TO THE CASSETTE BASIC ENTRY POINT.
;
; IPL ASSUMPTIONS
;   8255 PORT 60H BIT 0
;   = 1 IF IPL FROM DISKETTE
;-----------------------------------------
    ASSUME  CS:CODE,DS:DATA
BOOT_STRAP  PROC    NEAR

    STI                 ; ENABLE INTERRUPTS
    MOV AX,DATA         ; ESTABLISH ADDRESSING
    MOV DS,AX
    MOV AX,EQUIP_FLAG   ; GET THE EQUIPMENT SWITCHES
    TEST    AL,1        ; ISOLATE IPL SENSE SWITCH
    JZ  H3              ; GO TO CASSETTE BASIC ENTRY POINT

;------ MUST LOAD SYSTEM FROM DISKETTE -- CX HAS RETRY COUNT

    MOV CX,4            ; SET RETRY COUNT
H1:                     ; IPL_SYSTEM
    PUSH    CX          ; SAVE RETRY COUNT
    MOV AH,0            ; RESET THE DISKETTE SYSTEM
    INT 13H             ; DISKETTE_IO
    JC  H2              ; IF ERROR, TRY AGAIN
    MOV AH,2            ; READ IN THE SINGLE SECTOR
    MOV BX,0            ; TO THE BOOT LOCATION
    MOV ES,BX
    MOV BX,OFFSET BOOT_LOCN
    MOV DX,0            ; DRIVE 0, HEAD 0
    MOV CX,1            ; SECTOR 1, TRACK 0
    MOV AL,1            ; READ ONE SECTOR
    INT 13H             ; DISKETTE_IO
H2: POP CX              ; RECOVER RETRY COUNT
    JNC H4              ; CF SET BY UNSUCCESSFUL READ
    LOOP    H1          ; DO IT FOR RETRY TIMES

;------ UNABLE TO IPL FROM THE DISKETTE

H3:                     ; CASSETTE_JUMP:
    INT 18H             ; USE INTERRUPT VECTOR TO GET TO BASIC

;------ IPL WAS SUCCESSFUL

H4:
    JMP BOOT_LOCN
BOOT_STRAP  ENDP

So, if the system didn't have a diskette or diskette drive (which wasn't present on entry-level IBM PC), BOOT_STRAP routine starts BASIC via INT 18H. The interrupt vector for 18H defines beginning of the 40KB ROM as the entry point to the BASIC:

DW  00000H              ; INTERRUPT 18H
DW  0F600H              ; ROM BASIC ENTRY POINT

16KB of RAM was enough to run BASIC programs according to the reference (SYSTEM BOARD. 2-4):

A minimum system would have 16 KB of memory with module sockets for an additional 48 KB. In a cassette version of the system, approximately 4 KB is used by the system leaving approximately 12 KB of user's space for BASIC programs.

  • Worthy description of the minimum system, but not an answer to the question asked. – Raffzahn Dec 13 '18 at 1:33
  • 1
    @Raffzahn "So, if the system didn't have a diskette or diskette drive" and then a description of how it boots. I'd say that it hits the nail on the head. It's a different interpretation of the question to yours, but I think it is an answer. (Careful that you don't assume the intentions or effort of the answerer.) – wizzwizz4 Dec 13 '18 at 6:54
  • 1
    @Raffzahn: A system with only 16K RAM isn't going to have a usable floppy drive. I'm not sure whether trying to install a drive in a 16K system would result in it simply ignoring the drive or crashing on bootup, but the question of which useless behavior would result doesn't seem very interesting. – supercat Dec 13 '18 at 16:19
  • 1
    @supercat I would go for marketing. Most logical load adress would be 0500h as 0400h is the BIOS area. 0500h is the first unused address. Then again, loading it at the upper end of available memory is an easy way avoide the need of a double copy, as the final DOS (with the boot block no longer needed) should reside as low as possible. So 7C00h seams like a compromise to allow the second boot stage to load more than 14.25 KiB DOS code (30.25 KiB max) as 14 KiB may have already looked too little when the BIOS was made. – Raffzahn Dec 13 '18 at 22:44
  • 1
    @Raffzahn your theory looks very reasonable, thank you. The page cites that Dr. David Bradley wasn’t considering 16K systems at all: glamenv-septzen.net/en/view/6 and for 32K systems it makes sense to give as much room as possible. Interestingly, 8086 CPU monitor loaded boot sector into 200h, and example boot loader for 86-DOS loaded the program into 400h: patersontech.com/dos/docs/86_dos_prog.pdf – roolebo Dec 13 '18 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.