Question: How to generate .com file?
Answer: For BorlandC 3.1: 1- copy myfile.c into BIN folder of BORLANDC. 2- From command prompt goto BIN directory. You will see C:\BORLANDC\BIN> at command prompt. 3- type this command. bcc – eMYFILE.COM -IC:\borlandc\include -LC:\borlandc\lib myfile.c 4- Now myfile.com is generated in BIN directory. Now type myfile.com to run the com file. For TurboC 2.01: 1- copy myfile.c into folder TC. 2- From command prompt goto TC directory. You will see C:\TC> at command prompt. 3- type this command. tcc -eMYFILE.COM -IC:\TC\include -LC:\TC\lib myfile.c 4- Now myfile.com is generated in TC directory. Now type myfile.com to run the com file.
Question: What is the difference between Application Programming and System Programming?
Answer: The main difference of systems programming when compared to application programming is that application programming aims to produce software which provides services to the user (e.g. word processor), whereas systems programming aims to produce software which provides services to the computer hardware. It also requires a greater degree of hardware awareness. In other words application programming facilitates the implementation of required processing that software is supposed to perform and system programming facilitates the acquisition of data from input devices and output of data to output devices.
Question: What compiler or IDE we may use for System Programming?
Answer: Examples discussed in this course are designed using BorlandC. So it is better to use Borland C 3.1 for compiling the code. You can download it from your vulms account from download section of cs609.
Question: What is the difference between Interrupt Service Routine and Interrupt Handler?
Answer: Interrupt Service Routine and Interrupt Handler is the same thing.
Question: What is the purpose of TSR program?
Answer: A TSR program is such program that loads and remains in memory even when it is not running. TSR refers to DOS programs that can be memory resident i.e. remaining in memory at all times once they are loaded. In other words you can say TSR is a program that remains loaded in conventional memory after you have terminated it.
Question: What is the difference between a simple program and a TSR program?
Answer: In case of simple program when a user exits, the memory that program is using, is usually freed for other programs. So this program must be reloaded from a disk back into memory for it to be used again. In case of TSR program when you run it, it loads itself into the computer’s memory and remains there for later use.
Question: Is it necessary to make .com file for the TSR program?
Answer: It is necessary. If you are trying to run a TSR program, you must have to compile your code in form of .com file.
Question: What is the relationship between device driver and Interrupt Service Routine?
Answer: A device driver is software that manages the operations of the device. Device driver usually contains the routines which perform I/O on the device. Most devices can generate interrupts in order to receive service from the operating system. So you might have to implement interrupt service routine to perform I/O operations for the device.
Question: How long a TSR program will reside in the memory after termination of program?
Answer: It will reside in memory until you switch off the system.
Question: What is paragraph?
Answer: Here paragraph show the memory. One paragraph is equal to 16 bytes in size.
Question: What are pseudo variables?
Answer: A pseudo variable acts like a variable as its value can be changed anywhere in the program but is not a true variable as it is not stored in memory. C programming language provides the use of pseudo variables to access various registers within the processor. The are various registers like AX, BX, CX and DX within the processor they can be directly accessed in a program by using their respective pseudo variable by just attaching a ‘_’ (underscore) before the register’s name e.g. _AX = 5; A = _BX .
Question: What is the difference between Pseudo variable and Normal Variable?
Answer: A variable can be defined a space within the memory whose value can be changed during the execution of a program but a pseudo variable acts very much like a variable as its value can be changed anywhere 2 in the program but is not a true variable as it is not stored in memory.
Question: What is the difference between exit() and keep() functions?
Answer: Exit function returns the execution to the parent shell program and de-allocates the memory allocated to the program whereas the keep() function also returns the execution to the parent program but the memory allocated to the process may still remain allocated.
Question: How interrupts are handled?
Answer: There are 256 possible interrupts from 0 to 255. Each interrupt has an associated interrupt routine to handle the particular condition. To organize the 256 interrupts, the starting addresses of the corresponding interrupt routines are arranged in the interrupt vector table. When an interrupt occurs, the processor automatically retrieves the starting address of the interrupt routine from the interrupt vector table. The starting address of each interrupt routine is specified in the table in terms of the offset address and segment address. Both addresses are 16 bits (2 bytes) wide. So each table entry occupies 4 bytes. The total length of the table is 256×4 or 1024 bytes (1K).
Question: What is interrupt stealing?
Answer: Interrupt stealing means we change the vector corresponding to that interrupt. As soon as the interrupt vector changes, that interrupt will be routed to the new handler. So introducing a new entry in the mapping table is called stealing an interrupt.
Question: What is the function of keyboard hook?
Answer: Interrupt 15 is a software interrupt and invoked by means of software. Its only 4F service is used to intercept the keyboard. This service is actually called by int 9H. This service does not perform any useful output, it is there to be intercepted by applications which need to alter the keyboard layout.
Question: What is dangling pointer?
Answer: A dangling pointer is a pointer that doesn’t actually lead anywhere. When some object is deleted or deallocated without changing the value of the pointer then the particular pointer still points to the memory location of the deallocated memory. Such pointers are called dangling pointer.
Question: What LPT stands for?
Answer: LPT stands for Line Printing Terminal.
Question: What is the difference between getche() & getch()?
Answer: getch() gets a character from keyboard but it does not echo to screen where as getche() gets a character from the keyboard and echoes to screen.
Question: What is the difference between unsigned int & int?
Answer: int represents a signed integer comprised of 2 bytes. It has a range of -32768 to 32767. Where as unsigned int represents an unsigned integer comprised of 2 bytes and its range is 0 to 65535.
Question: How biosdisk is limited to accessing a maximum of 1024 tracks?
Answer: BIOS disk do not support disks with more than 1024 cylinders. Interrupt 13H has a standard register interface in which cylinder number of a disk is partly contained in two different registers, 8-bit CH register which contains the lower 8 bits of the cylinder number, and 8-bit CL register which contains 2 higher bits of the cylinder number. When combined, this creates a 10-bit cylinder number, which gives us a limit of 1024 (0 to 1023).
Question: What is the purpose of Timing signal in Synchronous communication?
Answer: Timing signal is required to identify the start and end of bits. In synchronous communications, the sender and receiver must synchronize with one another before data is sent. To maintain clock synchronization over long periods, a special bit-transition pattern is embedded in the digital signal that assists in maintaining the timing between sender and receiver.
Question: What is the difference between outport and outportb?
Answer: outport() outputs a word or write a word to a hardware port whereas outportb() outputs a byte or write a byte to a hardware port.
Question: What is the difference between ASCII and Scan Code?
Answer: When we press any key on the keyboard a scan code is generated by the keyboard controller tell the keyboard buffer which key have been pressed. Then for further use this scan code is converted to ASCII code. A scan code is a number, or sequence of numbers, is assigned to each key on the keyboard.
Question: What is the difference between internal fragmentation and external fragmentation?
Answer: Internal fragmentation is the space wasted inside of allocated memory blocks because of restriction on the allowed sizes of allocated blocks. Allocated memory may be slightly larger than requested memory;
this size difference is memory internal to a partition, but not being used. External Fragmentation happens when a dynamic memory allocation algorithm allocates some memory and a small piece is left over that cannot be effectively used. If too much external fragmentation occurs, the amount of usable memory is drastically reduced. Total memory space exists to satisfy a request, but it is not contiguous.
Question: What is the difference between DX & EDX?
Answer: There is only difference of size. EDX is a 32 bit register and DX is a 16 bit register.
Question: What is the purpose of studying the course of system programming?
Answer: The purpose of this course is to familiarize you with the internal working of different components of computer, how to control these components, different types of file system and their working and how to develop device drivers for different devices. At this level main purpose of this course is to clear your concepts and provide you a platform using which you can learn advance topics of system programming.
Question: What is the purpose of using LPT ports?
Answer: LPT (line print terminal) is the usual designation for a parallel port connection to a printer or other device on a personal computer. Most PCs come with one or two LPT connections designated as LPT1 and LPT2. Some systems support a third, LPT3. Whatever the number, LPT1 is the usual default. You can add a parallel port for a second printer or other device by buying and adding a parallel port adapter card to your computer. An LPT port can be used for an input device such as QuickCam, a video camera.
Question: Why in 32 bit addressing, accessing speed is fast if the addresses are multiples of 4 and slow if odd?
Answer: As you know when we have 32 bit data bus we can transfer 4 bytes in single bus cycle. So for this purpose address should be a multiple of 4. If it is odd then you may need more than 1 bus cycle to transfer 4 bytes, which automatically reduce the speed.
Question: What is the method to get interrupt vector from interrupt vector table?
Answer: We’ll multiply interrupt number by 4.
Question: What are different methods to avoid loading redundant copies of TSR program?
Answer: Use global variables as flag Use a memory area as a flag which is global to all programs e.g. IVT.
Question: What is block transfer mode of DMA?
Answer: In block transfer mode entire block is transferred on each trigger. This transfer halts the CPU, and will transfer each memory location one at a time. This mode disables the module when the transfer is complete. During the transfer, the bus remains under the control of the DMA controller, so the CPU cannot access the bus.
Question: What is synchronous serial I/O?
Answer: Synchronous communication occurs when sender and receiver share a common signal pulse. This common signal pulse helps to synchronize their actions. For example, the sender always sends the next bit over the line immediately prior to a new clock pulse and the receiver knows that when the clock pulse occurs it can now retrieve this bit. Sender and receiver are therefore “synchronized”. So a timing signal is required to identify the start and end of a bit in synchronous communication.
Question: What does IDE stands for?
Answer: IDE stand for integrated drive electronics.
Question: Explain DMA mode register?
Answer: As its name suggests, the mode register determines a channel’s operating mode. You can specify if the next DMA transfer will happen as a single transfer, a block transfer, or a demand transfer. It also specifies if the channel is to cascade two DMA controllers. In most cases you won’t have to change this later setting since this happens when the computer is booted.
Question: Explain DMA mask register?
Answer: There are two mask registers. They are used to either turn off or reactivate a channel. If a DMA channel is to be deactivated, the preferred option is to turn off the channel.
Question: What is single transfer mode of DMA?
Answer: In Single transfer mode the DMA transfers a single byte on each request and updates the counter registers on each transfer and the registers need not be programmed again. On the next request the DMA will again transfer a single byte beginning from the location it last ended.
Question: What is demand transfer mode of DMA?
Answer: Demand transfer is same as block transfer, only difference is that the DREQ signal remains active throughout the transfer and as soon as the signal deactivates the transfer stops and on reactivation of the DREQ signal the transfer may start from the point it left.
Question: Explain DMA request register?
Answer: The request register is used to initiate a DMA transfer under software control. The request register is also used to initiate a memory to memory transfer. If a DMA request is simulated over the request register, its response depends on whether other, higher priority DMA requests are pending. If so, the DMA request must until for its turn to be serviced. During this time, the request can again be turned off using the request register. This is done by setting the 2, called the request bit, for the respective channel number.
Question: What is the usage of DREQ signal?
Answer: When a device needs to perform An I/O then it will use the DMA request (DREQ) signal.
Question: What is Typematic Rate?
Answer: Typematic rate is the amount of time a computer will repeat a single character when its key is held down and the typematic rate delay is the initial delay before key auto-repeat starts.
Question: How can I get the dump of the memory locations e.g. BPB?
Answer: You can read the contents of boot sector through some utility like bootsector explorer. You can download it from download section of CS609. After reading the contents you can save them in .bin file and can read it using debug utility also.
Question: What is the difference between primary partition and extended partition?
Answer: In simple words a primary partition is partition that is used to start an operating system. There can be up to a maximum of four primary partitions on a single basic disk and only one of them can be active at a time. Whereas an extended partition is a partition that can be sub divided into logical drives.
Question: What is the purpose of partition table signature?
Answer: Partition table signature indicates that whether partition table code part contains valid executable code or not.
Question: What is master boot record (MBR)?
Answer: In every hard disk there must be a starting point where key information is stored about the disk, such as how many partitions it has, what sort of partitions they are, etc. There also needs to be somewhere that the BIOS can load the initial boot program that starts the process of loading the operating system. The place where this information is stored is called the master boot record (MBR). The master boot record is always located at cylinder 0, head 0, and sector 1, the first sector on the disk.
Question: What is the difference between sectors and tracks?
Answer: Tracks are the circular division of the disk and the sectors are the longitudinal division of the disk. In simple words a sector is a subdivision of a track.
Question: What is IDE hard drive technology?
Answer: IDE is the most popular interface used in modern hard disks. This interface is also known by a truly staggering variety of other names such as ATA, ATA/ATAPI, EIDE, ATA-2, Fast ATA, ATA-3, Ultra ATA, Ultra DMA and many more as well. The invention of this interface catapulted hard disks into a new era of performance, reliability, and compatibility. IDE/ATA hard disks are used on the vast majority of modern PCs, and offer excellent performance at relatively low cost.
Question: What is SCSI hard drive technology?
Answer: The second most popular hard disk interface used in PCs today is the Small Computer Systems Interface (SCSI). SCSI is a much more advanced interface than its chief competitor, IDE/ATA, and has several advantages over IDE that make it preferable for many situations, usually in higher-end machines. It is far less commonly used than IDE/ATA due to its higher cost and the fact that its advantages are not useful for the typical home or business desktop user.
Question: What is SATA hard drive technology?
Answer: Serial ATA (SATA) is an evolution of the Parallel ATA physical storage interface. Serial ATA is a serial link – a single cable with a minimum of four wires creates a point-to-point connection between devices. Transfer rates for Serial ATA begin at 150MB/s. Starting with SATA, it extends the capabilities of ATA and offers transfer rates starting at 150MB/s and, after years of development, has moved to the mainstream of disk interfaces.
Question: What is the difference between rotational delay and seek time?
Answer: In order to read or write data in a particular place on the disk, the read/write head of the disk needs to be physically moved to the correct place. This process is known as seeking, and the time it takes for the head to move to the right place is the seek time. Whereas rotational delay is the amount of time it takes for the disk to rotate until the required location on the disk reaches the read/write head.
Question: What is Platter and what is its function?
Answer: The platter is the component of the hard disk where all data is stored. The platter is usually a magnetic material that is used for the storage of the data. Platter is the usually a circular shaped disk. For more information see the following link. http://www.storagereview.com/map/lm.cgi/platters
Question: What is the difference between low level format and quick format?
Answer: In low level formatting system sets control information such as track and sector numbers and writing the control structures that define where the tracks and sectors are. Whereas quick formatting is the process of setting up an empty file system on the disk means only writing the file system structure e.g. boot block, FAT and etc.
Question: What is the difference between Isolated I/O and Memory Mapped I/O?
Answer: In case of Isolated I/O, I/O ports are used to hold data temporary while sending/receiving the data to/from the I/O device. If the similar function is performed using a dedicated part of main memory then the I/O operation is memory mapped.
Question: What is reentrant procedure?
Answer: If values within the registers are unchanged on return of a function as compared to the values which were stored in registers on entry into the procedures then the procedure is called reentrant procedure.
Question: Why hardware interrupts are non preemptive?
Answer: The reason for this non-preemptive can be understood by the example illustrated as below. Let’s first consider that the hardware interrupts are preemptive for argument sake. If a character ‘A’ is input a H/W interrupt will occur to process it, while this interrupt is being processed another character is input say ‘B’ in case the interrupts have been preemptive the previous instance will be preempted and another instance for the H/W interrupt call will be generated, and similarly consider another character is input ‘C’ and the same happened for this input as well. In this case the character first to be fully processed and received will be ‘C’ and then ‘B’ will be processed and then ‘A’. So the sequence of input will change to CBA while the correct sequence would be ABC.
Question: What is the advantage of parallel communication?
Answer: Parallel communication is much faster, but is only economically feasible for shorter distances.
Question: What are different types of serial communication?
Answer: There are two types of serial communication. Synchronous Communication Asynchronous Communication
Question: What are the advantages and disadvantages of serial communication?
Answer: The advantage of serial communication is less cost and its disadvantage is that the speed of transmission is reduced.
Question: What is null modem?
Answer: Modem is generally used to send/receive data to/from an analog telephone. If data is to be transferred from one computer to another through some media which can carry digital data then the modem can be eliminated and the UART on both computers can be interconnected. Such arrangement is called a NULL modem.
Question: What is real time clock?
Answer: Real time clock is a device incorporated into the PC to update time even if the computer is off. It has the characteristics which enables it to update time even if the computer is off.
Question: What is DMA?
Answer: DMA is a device which can acquire complete control of the buses and hence can be used to transfer data directly from port to memory or vice versa. Transferring data like this can prove faster because a transfer will consume 2 bus cycles if it is performed using the processor. So in this approach the processor is bypasses and its cycles are stolen and are used by the DMA controller.
Question: What is rotational delay?
Answer: While accessing a selected block the time required by the disk to rotate to the specified sector is called rotational delay
Question: What is seek time?
Answer: While accessing a selected block time required by the head to reach the particular track/cylinder is called seek time.
Question: What is access time?
Answer: The accumulative time that is required to access the selected block is called access time Access time includes the delay required by disk rotation as well as head movement.
Question: What is the difference between LBA and LSN address?
Answer: LSN is also indexed like LBA the only difference is that LBA is the address relative to the start of physical drive (i.e. absolute), whereas LSN address is the address from the start of logical partition i.e. relative.
Question: What is the purpose of file control block?
Answer: Control information about files is maintained in a data structure called the File control block (FCB). The
FCB for each file is created and stored in the disk.
Question: What does LBA stands for? Answer: Logical block addressing Question: What does LSN stands for? Answer: Logical sector number
Question: What’s the reason, why the upper four bits are ignored in the FAT 32?
Answer: The upper 4 bits are stated by Microsoft as being reserved and might have a special meaning in future
FAT32 implementations.
Question: How deleted files are recovered?
Answer: The contents can be recovered by placing a valid file name character in place of E5 and then recovering the chain of clusters in FAT. If somehow the clusters used by deleted file have been overwritten by some other file, it can not be recovered.
Question: What is DPB and what is difference between DPB and BPB?
Answer: BIOS parameter block is a data structure maintained by DOS in the boot block for each drive. Whereas DPB is an internal data structure of DOS and resides in main memory. Information in DPB is derived from BPB.
Question: What is boot block?
Answer: A dedicated block usually at the beginning (first block on first track) of a storage medium that holds special data used to start a system. Boot block contains some code and data. It is executed at the booting time.
Question: Is it necessary to remember all the bytes attributes (from exam point of view) of corresponding FAT12, FAT16, and FAT32?
Answer: In case of large or complicated structures, hint or its details will be given to you. But you need to understand them well and you have to understand their usage. You need to remember important registers their values. Like it will not be mentioned that service number will be stored in AH register.
Question: What is the difference between push, pushf, pushfd and pop, popf, popfd?
Answer: Push transfers bits of EFLAGS onto the stack. PUSHF saves a 16 bit value while PUSHFD saves a 32 bit value onto the stack. This action can be reversed through POPF or POPFD instructions.
Question: What is the difference between logical address and physical address?
Answer: Logical address is the address at which a memory location appears to reside from the perspective of an executing application program. This may be different from the physical address due to the operation of a memory management unit (MMU) between the CPU and the memory bus. Physical memory may be mapped to different logical addresses for various purposes. For example, the same physical memory may appear at two logical addresses and if accessed by the program at one address, data will pass through the processor cache whereas if it is accessed at the other address, it will bypass the cache. Physical address, also real address, or binary address, is the memory address that is electronically (in the form of binary number) presented on the computer address bus circuitry in order to enable the data bus to access a particular storage cell of main memory.
Question: What is meant by BCD?
Answer: Binary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is represented by its own binary sequence. Its main virtue is that it allows easy conversion to decimal digits for printing or display and faster decimal calculations.
Question: From where I can download the setup of BorlandC?
Answer: You can download borlandc from download section of CS609 from your VULMS account.
Question: What is head in terms of hard disk drive?
Answer: Head is a device through which we can read or write data on the surface of disk.
Share your Mid Term CS609 Paper here,………….