WS1.2-OS Intro
WS1.2-OS Intro
Q.3 List some differences between personal computer operating systems and mainframe
operating systems.
User Base: Personal computer operating systems are designed for single or a few
users, while mainframe operating systems cater to hundreds or thousands of users
simultaneously.
Resource Management: Mainframe operating systems are designed for extensive
resource management, handling larger volumes of data and more complex
scheduling and security requirements.
Purpose: PC operating systems are typically used for general-purpose computing,
while mainframes focus on large-scale computing tasks like transaction processing
and batch jobs.
Complexity and Cost: Mainframe systems are generally more complex and
expensive, reflecting their enterprise-level use.
Q.5 On early computers, every byte of data read or written was directly handled by the CPU
(i.e.there was no DMA. What implications does this organization have for
multiprogramming ?)
CPU Utilization: The CPU spends a significant amount of time handling I/O
operations, leading to underutilization of CPU for actual processing tasks.
Efficiency: Multiprogramming becomes less efficient since the CPU has to be
involved in I/O, reducing the time it can spend executing multiple programs.
Q6. Which of the following instructions should be allowed only in kernel mode?
(a) Disable all interrupts.
(b) Read the time-of-day clock.
(c) Set the time-of-day dock.
(d) Change the memory map.
Yes, the write() system call can return a value less than nbytes if there is an error during
the write operation, if the disk space is insufficient, or if the file is a special type of file such
as a pipe or socket and the other end is closed or full.
Q8. A file whose file descriptor is fd contains the following sequence of bytes: 3, 1, 4, 1, 5, 9,
2, 6, 5, 3, 5. The following system calls are made:
lseek(fd, 3, SEEK_SET);
read(fd, &buffer, 4);
where the lseek call makes a seek to byte 3 of the file. What does buffer contain after the
read has completed?
After the lseek(fd, 3, SEEK_SET); and read(fd, &buffer, 4); calls, buffer will contain the
bytes 1, 5, 9, 2. This is because lseek sets the file position to the fourth byte (starting from
0), and read then reads the next four bytes.
Q9.
A computer uses the relocation scheme of Fig. 1-9(a). A program is 10,000 bytes long and is
loaded at address 40,000. What values do the base and limit register get according to the
scheme described in the text?
Base Register: It gets the value 40,000, which is the starting address of the
program.
Limit Register: It gets the value 10,000, which is the length of the program. This is
used to ensure the program does not access memory beyond its allocated space.