Explain the concept of an Operating System (OS) and describe its types, functions and role in a computer system. Also, explain the commands to create new file and directory in MS-DOS.
10 marks
Question source
- Exam year
- 2081 BS / 2025 AD
- Level
- Level 4
- Paper
- Subjective
- Section
- Technical & Applied Questions (100 Marks)
Model answer
An operating system (OS) is system software that manages a computer's hardware and software resources and provides common services to application programs. It acts as an intermediary between the user or application and physical components such as the CPU, memory, storage and input/output devices. Examples include Microsoft Windows, GNU/Linux, macOS, Android and real-time operating systems used in embedded equipment.
Major types of operating systems
- Batch OS: Similar jobs are collected and executed in batches with little or no interaction during processing. Payroll and large periodic reports are traditional examples.
- Time-sharing or multi-user OS: CPU time is divided into small slices so multiple users or processes receive responsive service. UNIX and Linux server systems support this model.
- Multitasking OS: One user can run several applications apparently at the same time, such as editing a document while downloading a file. Windows, macOS and Linux are multitasking systems.
- Multiprocessing OS: It uses two or more processors or CPU cores to execute work concurrently and improve performance and reliability.
- Real-time OS (RTOS): It responds within defined time limits. A hard real-time system cannot miss a critical deadline, while a soft real-time system can tolerate limited delay. Industrial control and medical devices are common uses.
- Network or distributed OS: A network OS manages shared users, files, printers and security across connected computers. A distributed OS coordinates several computers so their resources can be used as a more unified system.
- Embedded and mobile OS: These systems are designed for dedicated devices or portable equipment, emphasizing limited resources, power management, sensors and communication.
These classifications can overlap; for example, a modern server OS may be multi-user, multitasking, multiprocessing and network-capable at the same time.
Main functions and role of an OS
- Process and CPU management: The OS creates and terminates processes, schedules CPU time, switches between tasks and coordinates processes that share resources.
- Memory management: It allocates and releases RAM, protects one process from another, and may provide virtual memory when programs need more working space than physical RAM provides.
- File and storage management: It organizes files and directories, maintains file systems, controls names and paths, tracks free space and provides operations such as create, open, read, write, copy and delete.
- Device and input/output management: Device drivers allow applications to use hardware through a consistent interface. The OS manages buffering, queues and spooling—for example, holding print jobs until the printer is ready.
- User interface: It provides a graphical user interface, command-line interface or both, enabling users to start programs, manage files and configure the computer.
- Security and protection: User authentication, permissions, process isolation, encryption support, audit logs and security policies protect resources against unauthorized access.
- Networking: The OS implements communication protocols, manages network adapters and supports shared resources and remote services.
- Error handling and accounting: It detects hardware or software errors, records events, supports recovery and monitors resource use and performance.
The OS therefore makes hardware usable, provides a stable platform for applications, allocates limited resources fairly and efficiently, and protects data and processes. Without an OS, each application would have to control hardware directly and provide its own storage, security and user-interface mechanisms.
Creating a directory in MS-DOS
The internal command MD (Make Directory), also written as MKDIR, creates a directory.
C:\>MD REPORTS
C:\>MD REPORTS\MONTHLY
The first command creates REPORTS in the current directory. The second creates the MONTHLY subdirectory. DIR can be used to confirm the result, and CD REPORTS changes the current directory to REPORTS.
Creating a new text file in MS-DOS
COPY CON copies text typed at the console into a file:
C:\REPORTS>COPY CON NOTES.TXT
Monthly report is ready.
^Z
1 file(s) copied.
After COPY CON NOTES.TXT, the user types the required content. Pressing Ctrl + Z marks the end of input, and Enter saves the file. The command TYPE NOTES.TXT displays its contents. For a one-line file, output redirection can also be used, for example ECHO Monthly report is ready. > NOTES.TXT; however, COPY CON is the conventional MS-DOS answer when interactive file creation is requested.