KERNAL
Encyclopedia
The KERNAL is Commodore
Commodore International
Commodore is the commonly used name for Commodore Business Machines , the U.S.-based home computer manufacturer and electronics manufacturer headquartered in West Chester, Pennsylvania, which also housed Commodore's corporate parent company, Commodore International Limited...

's name for the ROM
Read-only memory
Read-only memory is a class of storage medium used in computers and other electronic devices. Data stored in ROM cannot be modified, or can be modified only slowly or with difficulty, so it is mainly used to distribute firmware .In its strictest sense, ROM refers only...

-resident operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

 core in its 8-bit
8-bit
The first widely adopted 8-bit microprocessor was the Intel 8080, being used in many hobbyist computers of the late 1970s and early 1980s, often running the CP/M operating system. The Zilog Z80 and the Motorola 6800 were also used in similar computers...

 home computer
Home computer
Home computers were a class of microcomputers entering the market in 1977, and becoming increasingly common during the 1980s. They were marketed to consumers as affordable and accessible computers that, for the first time, were intended for the use of a single nontechnical user...

s; from the original PET
Commodore PET
The Commodore PET was a home/personal computer produced from 1977 by Commodore International...

 of 1977, followed by the extended but strongly related versions used in its successors; the VIC-20
Commodore VIC-20
The VIC-20 is an 8-bit home computer which was sold by Commodore Business Machines. The VIC-20 was announced in 1980, roughly three years after Commodore's first personal computer, the PET...

, Commodore 64
Commodore 64
The Commodore 64 is an 8-bit home computer introduced by Commodore International in January 1982.Volume production started in the spring of 1982, with machines being released on to the market in August at a price of US$595...

, Plus/4, C16
Commodore 16
The Commodore 16 was a home computer made by Commodore with a 6502-compatible 8501 CPU, released in 1984. It was intended to be an entry-level computer to replace the VIC-20 and it often sold for 99 USD...

, and C128
Commodore 128
The Commodore 128 home/personal computer was the last 8-bit machine commercially released by Commodore Business Machines...

. The Commodore 8-bit machines' KERNAL consisted of the low-level, close-to-the-hardware OS routines roughly equivalent to the BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

 in IBM PC compatibles (in contrast to the BASIC interpreter
Commodore BASIC
Commodore BASIC, also known as PET BASIC, is the dialect of the BASIC programming language used in Commodore International's 8-bit home computer line, stretching from the PET of 1977 to the C128 of 1985...

 routines, also located in ROM), and was user-callable via a jump table whose central (oldest) part, for reasons of backwards compatibility, remained largely identical throughout the whole 8-bit series. The KERNAL ROM occupies the last 8 KB
Kilobyte
The kilobyte is a multiple of the unit byte for digital information. Although the prefix kilo- means 1000, the term kilobyte and symbol KB have historically been used to refer to either 1024 bytes or 1000 bytes, dependent upon context, in the fields of computer science and information...

 of the 8-bit CPU's 64 KB address space ($E000-$FFFF).

The KERNAL was initially written for the Commodore PET by John Feagans, who introduced the idea of separating the BASIC routines from the operating system. It was further developed by several people, notably Robert Russell added many of the features for the VIC-20 and the C64.

Example of use

A simple, yet characteristic, example of applying the KERNAL is given by the following 6502
MOS Technology 6502
The MOS Technology 6502 is an 8-bit microprocessor that was designed by Chuck Peddle and Bill Mensch for MOS Technology in 1975. When it was introduced, it was the least expensive full-featured microprocessor on the market by a considerable margin, costing less than one-sixth the price of...

 assembly language
Assembly language
An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices. It implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture...

 subroutine (written in ca65 assembler format/syntax):

CHROUT = $ffd2 ; CHROUT sends a character to the current output device
CR = $0d ; PETSCII
PETSCII
PETSCII , also known as CBM ASCII, is the variation of the ASCII character set used in Commodore Business Machines 's 8-bit home computers, starting with the PET from 1977 and including the VIC-20, C64, CBM-II, Plus/4, C16, C116 and C128...

 code for Carriage Return
;
hello:
ldx #0 ; start with character 0
next:
lda message,x ; read character X from message
beq done ; we're done when we read a zero byte
jsr CHROUT ; call CHROUT to output char to current output device (defaults to screen)
inx ; next character
bne next ; loop back while index is not zero (max string length 255 bytes)
done:
rts ; return from subroutine
;
message:
.byte "Hello, world!"
.byte CR, 0 ; Carriage Return and zero marking end of string

This code stub employs the CHROUT routine, whose address is found at address $
Hexadecimal
In mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen...

FFD2
(65490), to send a text string to the default output device (e.g., the display screen).

About the misspelling

The KERNAL was known as kernel inside of Commodore since the PET days, but in 1980 Robert Russell misspelled the word in his notebooks forming the "word" kernal. When Commodore technical writers Neil Harris and Andy Finkel collected Russell's notes and used them as the basis for the VIC-20 programmer's manual, the misspelling followed them along and stuck.

According to early Commodore myth, and reported by writer/programmer Jim Butterfield
Jim Butterfield
-External links:* * featuring Brad Templeton, Jim Butterfield, and Steve Punter** * * , previous unpublished, presented by the Personal Computer Museum, Brantford, Ontario...

 among others, the "word" KERNAL is an acronym (or maybe more likely, a backronym
Backronym
A backronym or bacronym is a phrase constructed purposely, such that an acronym can be formed to a specific desired word. Backronyms may be invented with serious or humorous intent, or may be a type of false or folk etymology....

) standing for Keyboard Entry Read, Network, And Link, which in fact makes good sense considering its role. Berkeley Softworks later used it when naming the core routines of its GUI OS for 8-bit home computers: the GEOS
GEOS (8-bit operating system)
GEOS is an operating system from Berkeley Softworks . Originally designed for the Commodore 64 and released in 1986, it provided a graphical user interface for this popular 8-bit computer.GEOS closely resembled early versions of Mac OS and included a graphical word processor and paint program...

 KERNAL.

The (completely different) OS core in the 16/32-bit Commodore Amiga
Amiga
The Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...

 series was called the Amiga ROM Kernel, using the correct spelling of kernel.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK