Please use the "Index" for better experience.

Saturday, October 01, 2011

Anatomy of CP/M

                        The major reason for creating CP/M was to provide users, software developers (hobbyists), and software and hardware manufacturers one  single, standard interface, as there was no standard interface at that time. To achieve this target of making CP/M a standard, CP/M was built in three different parts: BIOS, BDOS, and CCP.
                        The BIOS (Basic I/O System), is a concept pioneered by Gary Kildall, which we still use in personal computers. This BIOS in CP/M, is similar to a monitor,but with standard specified functions and interfaces. The BIOS is a set of programs, usually stored in a ROM chip which placed on the motherboard. The BIOS directly controls hardware components other than microprocessor, and memory. Each manufacturer of computer kits, who wanted to use CP/M on their computers, was supposed to adapt this BIOS. (Later, all of the manufacturers, almost all of them, adapted this concept of BIOS.) The interface to BIOS, however, is the same, no matter how the underlying devices might work.
                        Gary called the core of the CP/M operating system as the BDOS, for Basic Disk Operating System. It is what we call the kernel today. It is independent of the hardware, and performs more primitive services. That means BDOS is same for all the hardware systems (with no changes), that CP/M is to run on. (In this time, DOS / monitors had to be written differently for each kind of hardware.)  Handling different types of hardware is task of the BIOS. The BDOS implements the CP/M filesystem, and some input/output abstraction*1 on top of the BIOS.
                        After BIOS, and BDOS; third and last component of the CP/M is the user interface: CCP – Console Command Processor. It is a text based user interface. Each of these components have size around 2000 to 4000 bytes. The BIOS, and BDOS are memory resident, that is they are always present in the memory. And, in the case of CCP, it is memory resident unless the memory is required for any other program. In such case, CCP would be over-written by the program (which requires the memory), and after the program finishes the execution, the CCP would be automatically reloaded in the memory. (More on this in “Memory Management”.)

                   The BIOS portion was always adapted to the particular hardware. Adding memory to a computer, for example, meant that the CP/M system had to be reinstalled. Once installed, the operating system (BIOS, BDOS and CCP) was stored in reserved areas at the beginning of any disk which would be used to boot the system. On start-up, the bootloader (usually contained in a ROM firmware chip) would load the operating system from the disk in drive A:
The major complexity of CP/M was reduced in the BDOS, and to a lesser extent, in the CCP and transient commands. This meant that by porting the limited number of simple routines in the BIOS to a particular hardware platform, the entire OS would work. This significantly reduced the development time needed to support new machines, and was one of the main reasons for CP/M's widespread use. Today this sort of abstraction is common to most OSs (a hardware abstraction layer), but at the time of CP/M's birth, OSs were typically intended to run on only one machine platform, and multilayer designs were considered unnecessary.



*1=A standardised interface that provides general system functions but hides all the messy hardware details is called as abstraction.

Thursday, September 22, 2011

Rise of CP/M : A Brief History



        In the 70's decade, there were many companies building computer kits, and all of them were providing a monitor program of their own. (There was issue about "Portability", which I'll explain later.) These monitors were small in memory, and required very few memory space varying from a few hundred to few thousand bytes. Typically a monitor provided only a few functions ranging from 10 to 15 functions. But these programs required time and expertise to develop, debug, and build. Even worse, there was no standard monitor.Each company simply added the functions they thought that users wanted. This created a problem for application programming. Because of the different monitor programs, application programs had to be especially written for each manufacturers computer. This situation led to development of CP/M [Control Program/Monitor].
        In 1973 Gary Kildall 1973 developed the first high-level programming language for microprocessors, called PL/M. While working for intel, in the same year,Gary created CP/M as the first operating system for the new microprocessor Intel 8080. He demonstrated CP/M to Intel, but Intel had little interest in CP/M and chose to market PL/M instead.
        Later, Gary and his wife Dorothy established a company, originally called "Intergalactic Digital Research" (later renamed as Digital Research, Inc), to market CP/M. Digital Research licensed CP/M for the IMSAI 8080, a popular clone of the Altair 8800. As more manufacturers licensed CP/M, it became a standard and CP/M had to support an increasing number of hardware variations. In response, Gary pioneered the concept of a BIOS, a set of simple programs stored in the computer hardware which enabled CP/M to run on different systems without modification.
        CP/M's quick success took Gary by surprise, and he was slow to update it for high density floppy disks and hard disks. After hardware manufacturers talked about creating a rival operating system, Gary started a rush project to develop CP/M 2. By 1981, at the peak of its popularity, CP/M ran on 3,000 different computer models and DRI had $5.4 million in yearly revenues.

Sources:

Study of Computers and History of Computers since last almost 12 years.

http://www.digitalresearch.biz/CPM.HTM (Official Home Page of CP/M)
http://en.wikipedia.org/wiki/CP/M
http://en.wikipedia.org/wiki/History_of_operating_systems

See Also :

http://en.wikipedia.org/wiki/Intel_8080 (The Intel 8080 Microprocessor)
http://en.wikipedia.org/wiki/Intel_4004  (World's first Microprocessor, an entire Central Processing Unit on one single chip)

Regards,
Kiran :)

End of Line <

Monitors: The Ancestors of Operating Systems

Note: This article is about the system monitors for early microchip based desktop computers. This is part of series of articles about CP/M, the operating system.
       Around 1974, when personal computing was very new, single chip microprocessors made it possible to build small, comparatively inexpensive computers. This lead to birth of several small start-up companies, which sold kits for home hobbyists who wanted to build their own computer. These kits typically contained a circuit board, a  microprocessor, some memory chips,(this means, these kits "typically" did not contain video monitors), and some additional device controller chips. These additional chips were for controlling various input and output devices like paper tape, cassette tape, and floppy disk drives.
        In early days, these computer systems had one to four kilobytes of memory, or sometimes even less. Application programs were written in machine language and/or assembly language.
        Because of this lack of memory, there was typically no operating system. But, there was a small "monitor program" usually stored in a ROM (Read Only Memory), that would allow an application to do simple common tasks, such as:
- get character from keyboard device
- output character to a device such as teleprinter or printer
- save the contents to a cassette tape or a floppy disk
- restore contents from tape or floppy

The monitors did only such basic tasks, that is all about them.

Sources :

http://en.wikipedia.org/wiki/History_of_personal_computers
http://en.wikipedia.org/wiki/History_of_operating_systems
http://en.wikipedia.org/wiki/Mark-8 

Regards,
Kiran :)

End of Line <

Wednesday, September 21, 2011

Some Basic Concepts and Terms regarding Operating System



        Here are some basic terms and concepts regarding operating systems, and computer hardware that we will need to study actual operating systems. Without knowing these concepts it will be sort of difficult to start.
First.I was thinking to explain these terms wherever occurred, but this would have made the blog posts a little lengthy and out of track.
So I decided to put them in the very beginning.
These definitions are not 100% formal, I've kept them on a very introductory level, they'll be explained wherever required.

  • Resources: A resource or a computer resource is any physical or virtual component of the computer system. Every device connected externally to a computer system is a resource. Every internal system component is a resource as well. That includes the processor (CPU), RAM ("memory" in nerd -peak), I/O devices and so on.
    Virtual system resources include virtual memory, files-systems, and so on.
  • Process: An informal, most basic definition is that "a program in execution is process." A computer program is just a collections of instructions for a computer. When a computer starts to obey these instructions, that is, "starts to execute" this program, it is called as process, that is it.
  • Devices: A device is a piece of hardware connected internally or externally to main computer system. (I don't know what it is called when it is not connected to the computer, every man has his flaws...) Hard disks, disc drives (CD/DVD drives), key-boards, and video monitors are typical devices to be found.
  • Device Controller: In simple language, device controller is part of the motherboard, it allows the motherboard to use the device. Technically, devices have a special electronic interface, called as device controller, which helps to connect a device or a group of similar devices to a computer system. Device controllers act like a glue between devices and main computer system. Just like the gluon inside a proton or neutron, who is responsible for sticking the quarks together.
  • Device Driver: (Not to be confused with device controller) This is a program which helps the software to use the hardware. (Device controller helps motherboard, device driver helps the software.) Device drivers are hardware-dependent and operating-system-specific.
  • BIOS: The first task of Basic Input/Output System is to identify standard system devices such as the video display card, keyboard and mouse, hard disk drive, optical disc drive and other standard hardware. After Accomplishing this task, BIOS is responsible for loading the operating system. BIOS program is stored on a non-volatile ROM chip, present on the motherboard.Usually this ROM is made of CMOS chip.
  • Kernel: Kernel is a program (actually set of programs or "module" in nerd-speak.), that is always running at all time on computer (unless it is turned off obviously, as mentioned previously.) or atleast  is always present in the main memory (RAM).
        In some cases (like Linux), the entire OS is created as one monolithic entity and this entire monolithic entity is called as kernel.
  • Services: One of the major tasks of operating system is to provide an environment for the execution of program(s). The OS provides some "services" to make the programming task easier. These services are provided provided not just to the user, but to the programs as well.
        The services provided may differ from OS to OS. But still, these services can be categorized according to their functionalities.
        The most familiar services to a common user are user interface and file manipulation. (yes, this might come as surprise, but user interface is a service.)
        In current days, a graphical user interface (GUI) is the most commonly used interface, other interface being command line interface also known as line based or text based interface.
        Talking about file manipulation, a user needs to read and write files, he also needs to create and delete them, programs as well, needs to perform same tasks regarding files. It is "file system"'s job to provide these services.
  • Utility Programs: The most common and informal definition is, the programs which help the OS to keep on working, but however, this definition is not completely correct.
        Utility programs are not the part of the OS kernel, but work closely with the kernel to provide the ease of use or access to the system information.

Monday, September 19, 2011

Reasons for Creating This Blog

September 19, 2011, Monday,
0500 Hours,
Parbhani, India.


       I've been studying computers since almost twelve years now. Since the beginning I was familiar with the concept of OS.
But I gained the actual depth of the subject around 2003.

       I started to study operating systems deeply roughly around 2006-07. While I was studying operating systems, I referred a lot of books. I realized that all of these books regardless their style, and language, had a basic structure in common.

       While studying any complex body, (a huge government or a huge constitution like India's [both the government and Constitution of India are biggest in the world.]), the most common technique is to partition the original structure of the body according to their functionality/work and then study the each part individually. After studying each part individually, study it in such way to understand how these different sections/parts fit together and work in harmony to form the original structure.

       Every book on operating system since the time of the ancient Romans has the same traditional method. According to this method, the OS is partitioned in several parts according to their work. After giving a very brief introduction to some concepts, terms and the parts of the OS in first chapter, the book starts discussing the parts of OS like Process Management, Memory Management, Security Management and so on. Then these "parts" have chapters inside it, for example Process Management has chapters like Process Scheduling, Process Communication, Co-operating Processes, Process Synchronization and what not. This makes each part isolated. Sometimes the reader gets frustrated and shouts out something like, "what the heck am I studying OS or Processes?"

       And after studying such isolated and humongous parts, we have to study one more part by the name "Case Study", example of actual operating systems, where we finally can see how these parts work together buoyantly in harmony as a real operating system.

       It is clear, if some computer enthusiast, who is not a student of computer science and still he is interested/curious about operating systems and wants to study them, then it is really difficult for him to study using such books.

       And thats exactly why i came up with this blog,
To help the such curious computer enthusiast. This blog is an attempt to explain the insights and works of operating systems in such a manner, that any person with knowledge of english and experience of using a computer would be able to understand the operating system.

Regards,
Kiran

End of Line<

Interesting History - I



        As a matter of fact, almost all the times in the history of computers there has been a debate, varying from polite discussions to fierce arguments to even political and almost religious arguments, about what an operating system do. These two groups of arguers can be categorized as the supporters of "the maximalist view" and "the minimalist view. As per the names suggest, the maximalist view state that the OS should provide as much services/functionalities as possible. And the minimalist view states exactly the opposite: only the most basic functionalities should be the part of the OS.

       According to the records, in 1998, the United States Department of Justice filed law suit against Microsoft Corporation. Stating that Microsoft included too much functionalities in its operating systems that it made extremely difficult to other software manufacturers to compete. For example, who would buy a web browser by the name "Earl's Smokin' Door to Internet", if a browser is already bundled in the "Windows"?
So, Microsoft was found guilty to use its monopoly of operating systems to prevent the competition.

One can get the detailed information about this lawsuit on wikipedia.org
here is the link:
http://en.wikipedia.org/wiki/United_States_v._Microsoft


Thursday, August 04, 2011

Entry 1 :The Definition of Operating System



            Defining an operating system isn't a simple nor an easy task.
By simple, I mean this discussion takes place in various places, such as college classrooms to college campus (after finishing the classroom discussion with "lets take this "outside", that might give you the idea.).
And that's not all, defining OS takes place even in courtrooms. (See the "Interesting History" .)

Anyways, here is my attempt:

            An OS is a collection of programs (or "modules" in nerd-speak), that manages and controls the resources of a computer, or other computing device and gives user, and programs an interface to utilize these resources.
According to Linus Torvalds, the major creator of Linux, "An OS is a resource allocator."

            However, in general, there is no universally accepted definition for an OS. ( I really am not sure, what computer scientists have been doing since last 70 years or so, but I think that as usual some government should be blamed for this issue as well.)

            In the early days of computing, the ancestors of operating systems, "monitor programs" were created for only one purpose. And even today, it is purpose of the OS: to provide an environment in which a user can execute program(s).

            So, one view of OS focuses on the to control various Input/Output devices. (that's what I/O will stand for hereafter, I'll not try to divide a letter with zero.) The OS also controls the execution of programs to prevent errors and improper use of the computer. (here, with "preventing improper use", I mean using the computer hardware as as efficiently as possible. That means, OS will not mind you enjoying "Baywatch" on your computer, and that also means that you can stare at Yasmeen Bleeth as long as you want.)

            The fundamental goal of an entire computer machine/system is to execute user program(s) and make the problem solving easier, and towards this goal computer hardware is created. Since the bare hardware is not particularly is to use, application programs are created. These programs require certain common operations, such controlling I/O devices. The common functions of controlling and allocating resources are then brought together into one piece of software: the operating system.

            There is no universally accepted definition of what is the part of the OS and what isnt. (ok, now really is the time for some government to be blamed.) The most common definition is that the OS is the one program running at all the the times on the computer (unless if it is turned off, obviously)(this program is usually called as a kernel), with all else being application programs. This definition is the one which is generally followed.
And this is the very definition that I follow.

Preface

August 04, 2011, Thursday,
1020 Hours.




This blog,
Will discuss operating systems only on theoretical levels.
It will elaborate in plain English, with a humorous style: what does an operating system do, what's inside it and how does it work.


The pre-requisites for reading this blog are only two basic things: good knowledge of English, and experience of "using" a computer.

Regards,
Kiran :)


End of Line <