Question: There are a lot of retro-computers with BASIC as an integral part of the operating system. The IBM 5100 was one of the first computers with a separate memory space for BASIC, followed by the Commodore PET, Apple II and TRS-80.

But why was BASIC built into their operating systems, using memory? From [this memory map](http://sta.c64.org/cbm64mem.html), the Commodore 64 had memory completely reserved for BASIC. There were computers, like the Altair 8800, that provided BASIC as software that could be loaded into memory when necessary, and these computers both worked and sold well.

So why was BASIC built into so many computers' operating systems?

Answer: 
Thraka is right that BASIC served the role of operating system on many 8-bit micros. *Some* OS was needed, that was beyond doubt. But at the time dedicated operating systems were either very limited (say, Atari DOS), overly complex, big and expensive for the tiny computers (Unix), or - for the middle ground, that was "just right" - in their infancy (CP/M).

BASIC, on the other hand, was touted THE beginner's programming language. 

At the time - 8-bit micros were primarily aimed at the kids and teens market. They were "home computers", where the dad could write and print letters, mom could design crosstitch images, but 90% of the time kids would be playing games. But if the computer was to be more than a glorified gaming console with hardly-used extra functions, it needed a marketing point that would set it apart from the consoles: **"It Teaches Your Kids Programming"** was the critical sales point. And so it needed a kid-friendly programming language.

BASIC had only one serious competitor for that position at the time: [Logo](https://en.wikipedia.org/wiki/Logo_%28programming_language%29), and while Logo was generally considered a much better learning tool\* but it hardly yielded towards "general use" - you could do some quite fancy stuff easily (drawing a [Koch Snowflake](https://en.wikipedia.org/wiki/Koch_snowflake) was less than a screen long program; not a packed screen too) but didn't yield well towards "common use", and was considerably slower. Other languages than the two either employed concepts too advanced for kids, or were too complex to implement on 8-bit micros (leaving enough memory for actual software too!).

...also - Microsoft Basic was an important language for "professional environment". Learning its simpler variants was considered (usually by clueless parents) an important building block towards building a career of using it professionally. Nobody ever wrote serious business software in Logo. Therefore the marketing appeal of Basic - despite its factual shortcomings - overshadowed Logo as THE language for learning.

On top of that, implementing OS procedures as BASIC commands was simple, natural and took little effort, little memory and allowed to integrate or script them as BASIC programs easily. Logo didn't yield itself to that purpose nearly as well.

And so, BASIC being simultaneously a comfortable OS environment, a scripting tool, a teaching tool, and - above all - an important marketing point - became the language of choice.

\* (e.g. providing recursion, which was between very difficult and impossible in Basic, lacking local variables, parametric function calls and rarely implementing easy to access arrays which could serve as a crutch for these). Also, the Turtle Graphics, which was excellent for teaching the concept of "giving commands", and building a library of procedures, but made utilizing the gfx as "pixel canvas" difficult.
Because at the time a personal computer without BASIC was a total non-starter. A personal computer without BASIC would seem as silly then as a computer without a web browser would seem today.

We considered BASIC interpreters essential in the 1970's and early 1980's because the modern concept of the personal computer as a machine on which one runs ready-made application programs was only beginning to emerge. BASIC was invented in 1964. Microsoft BASIC was released in 1975. Wordstar was released in 1978, Visicalc in 1979, Wordperfect in 1979, Microsoft Word in 1983, Lotus 123 in 1983. If you were a user then, you might have heard of some of these programs, you might be able to get a copy of one of them, and it might run on your computer (but probably would not).

Making practical use of a computer without programming was still very much a new idea. BASIC was seen as a language which end users would use to solve problems. I learned it from the 1975 book "Making BASIC Work For You". It is all about how to solve business accounting and record-keeping problems. The examples are things which today would be done using spreadsheets and other office applications.

The computer buyer was also different. The average person did not think that he ever would or ever could operate a computer and so had no desire to own a home computer. They were bought by hobbyists who valiantly tried to show their friends that the machines had some practical value (which was hard since most tasks took two or three times as long on a computer) and by parents who realized that microcomputers, even if useless now, were the wave of the future and wanted their children to "learn programming". In both cases it was essential that the computer be programmable.