Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 17

www.vchowk.

com

CS401 FINALTERM 2010 SOLVED SPRING Time: 90 min M a r k s: 58

Question No: 1

( M a r k s: 1 )

http://vuzs.net

SP is associated with. By default SS DS CS ES

Question No: 2

( M a r k s: 1 )

http://vuzs.net

Which bit of the attributes byte represents the red component of foreground color 5 4 3 2

Question No: 3

( M a r k s: 1 )

http://vuzs.net

An 8 x 16 font is stored in ______________ bytes.

2 4 8 16

www.vchowk.com

Question No: 4

( M a r k s: 1 )

http://vuzs.net

In DOS input buffer, the number of characters actually read on return is stored in ___________ byte.

third fourth first second

Question No: 5

( M a r k s: 1 )

http://vuzs.net

Which of the following gives the more logical view of the storage medium BIOS DOS Both None

Question No: 6

( M a r k s: 1 )

http://vuzs.net

In STOSW instruction, when DF is clear, SI is

Incremented by 1

Incremented by 2

Decremented by 1

Decremented by 2

www.vchowk.com

Question No: 7

( M a r k s: 1 )

http://vuzs.net

Which of the following interrupts is Non maskable interrupt

INT 2 INT 3 INT 0 INT 1

Question No: 8

( M a r k s: 1 )

http://vuzs.net

Which of the following IRQs is connected to serial port COM 2?

IRQ 0 IRQ 1 IRQ 2 IRQ 3

Question No: 9

( M a r k s: 1 )

http://vuzs.net

The time interval between two timer ticks is ?

40ms 45ms 50ms 55ms

www.vchowk.com Question No: 10 ( M a r k s: 1 ) http://vuzs.net

The physical address of IDT( Interrupt Descriptor Table) is stored in _______ GDTR IDTR IVT IDTT

Question No: 11

( M a r k s: 1 )

http://vuzs.net

In NASM an imported symbol is declared with the ............................ while and exported symbol is declared with the ............................ Global directive, External directive External directive, Global directive Home Directive, Foreign Directive Foreign Directive, Home Directive

Question No: 12

( M a r k s: 1 )

http://vuzs.net

In 68K processors there is a 32bit ...................... that holds the address of currently executing instruction Program counter Stack pointer Register Stack

Question No: 13

( M a r k s: 1 )

http://vuzs.net

Single step interrupt is Hardware interrupt Like divide by zero interrupt

www.vchowk.com Like divide by 1 interrupt Software interrupt

Question No: 14

( M a r k s: 1 )

http://vuzs.net

Which of the following is NOT true about registers: Their operation is very much like memory Intermediate results may also be stored in registers They are also called scratch pad ram None of given options

Question No: 15 Types of jump are: short, near

( M a r k s: 1 )

http://vuzs.net

short, near, far near, far short, far

Question No: 16

( M a r k s: 1 )

http://vuzs.net

MS DOS uses ____ display mode. Character based Graphics based Numeric based Console based

Question No: 17

( M a r k s: 1 )

http://vuzs.net

Which of the following IRQs is derived by a timer device?

www.vchowk.com

IRQ 0 IRQ 1 IRQ 2 IRQ 3

Question No: 18

( M a r k s: 1 )

http://vuzs.net

In programmable interrupt controller, which of the following ports is referred as a control port. 19 20 21 22

Question No: 19

( M a r k s: 1 )

http://vuzs.net

INT 21 service 01H is used to read character from standard input with echo. It returns the result in ______ register.

AL BL CL BH

Question No: 20

( M a r k s: 1 )

http://vuzs.net

In 9pin DB 9, which pin number is assigned to DSR (DataSet Ready) ? 4 5 6

www.vchowk.com 7

Question No: 21

( M a r k s: 1 )

http://vuzs.net

In 9pin DB 9, which pin number is assigned to TD (Transmitted Data) ? 1 2 3 4

Question No: 22

( M a r k s: 1 )

http://vuzs.net

In 9pin DB 9, Signal ground is assigned on pin number 4 5 6 3

Question No: 23

( M a r k s: 1 )

http://vuzs.net

8088 is a ........................... 16 bit processor 32 bit processor 64 bit processor 128 bit processor

Question No: 24

( M a r k s: 1 )

http://vuzs.net

The table index (TI) is set to _____ to access the GDT (Global Descriptor Table).

www.vchowk.com 1 0 -1 -2

Question No: 25

( M a r k s: 1 )

http://vuzs.net

VESA(Video Electronics Standards Association) organizes 16 color bits for every pixel in 5:5:5 format 5:6:5 format 6:5:6 format 5:6:7 format

Question No: 26

( M a r k s: 1 )

http://vuzs.net

Which flags are NOT used for mathematical operations ? Carry, Interrupt and Trap flag. Direction, Interrupt and Trap flag. Direction, Overflow and Trap flag. Direction, Interrupt and Sign flag.

Question No: 27

( M a r k s: 2 )

Write instruction to allocate space for 32 PCBs.

Ans:

multitasking kernel as a TSR [org 0x0100]

www.vchowk.com jmp start

PCB layout: ax,bx,cx,dx,si,di,bp,sp,ip,cs,ds,ss,es,flags,next,dummy 0, 2, 4, 6, 8,10,12,14,16,18,20,22,24, 26 , 28 , 30

Question No: 28 Define short jump

( M a r k s: 2 )

Ans; The jump is called a short jump, If the offset is stored in a single byte as in 75F2 with the opcode 75 and operand F2, the jump is called a short jump. F2 is added to IP as a signed byte

Question No: 29 return the results ?

( M a r k s: 2 ) uses which two 8bit registers to

INT 14 - SERIAL - READ CHARACTER FROM PORT

Ans;
14 - SERIAL - READ CHARACTER FROM PORT

uses these two 8bit registers to return

the results: AH = line status AL = received character if AH bit 7 clear

Question No: 30

( M a r k s: 2 )

Which registers are uses as scratch when we call a function? Ans:

www.vchowk.com Following registers are uses as scratch when we call a function


EAX ECX EDX

Question No: 31

( M a r k s: 3 )

VESA service "INT 10 VESA Get SuperVGA Information" uses which registers to return the result?

To return the result, "INT 10 VESA Get SuperVGA Information uses: Return: AL = 4Fh if function supported AH = status

Question No: 32

( M a r k s: 3 )

Define the protected mode.

When the processor switches into 32bit mode it is called protected mode. It can be accessed by turning on least significant bit of a register called CR0 (Control Register 0) and the processor switches into 32bit mode. All registers in 386 have been extended to 32bits. The new names are EAX, EBX, ECX, EDX, ESI,

www.vchowk.com EDI, ESP, EBP, EIP, and EFLAGS. The original names refer to the lower 16bits of these registers. A 32bit address register can access upto 4GB of memory so memory access has increased a lot.

Question No: 33

( M a r k s: 3 )

Describe briefly INT 3 functionality.

The functionality of INT 3 is this , its Debug Interrupt. The special thing about this interrupt is that it has a single byte opcode and not a two byte combination where the second byte tells the interrupt number which allows it to replace any instruction what soever. It is also used by the debugger.

Question No: 34

( M a r k s: 5 )

Read the passage carefully and choose proper word for each blank space from the list given below .

In descriptors the 32bit base is scattered into different places because of compatibility reasons. The limit is stored in 20 bits but the ...............defines that the limit is in terms of bytes of 4K pages therefore a maximum of 4GB size is possible. The ................. must be set to signal that this segment is present in memory. DPL is the descriptor privilege level again related to the protection levels in 386. .................. defines that this segment is to execute code is 16bit mode or 32bit mode. .................. is conforming bit that we will not be using. ..................signals that the segment is readable. A bit is automatically set whenever the segment is accessed.

(A bit, C bit, G bit, D bit, P bit , R bit, B bit)

www.vchowk.com

SOLUTION: In descriptors the 32bit base is scattered into different places because of compatibility reasons. The limit is stored in 20 bits but the ....... G bit........defines that the limit is in terms of bytes of 4K pages therefore a maximum of 4GB size is possible. The .......P bit.......... must be set to signal that this segment is present in memory. DPL is the descriptor privilege level again related to the protection levels in 386. ........D bit.......... defines that this segment is to execute code is 16bit mode or 32bit mode. .........C......... is conforming bit that we will not be using. .......R bit...........signals that the segment is readable. A bit is automatically set whenever the segment is accessed.

Question No: 35

( M a r k s: 5 )

Answer the following: Ans: These are operating system extensions which become part of the operating system and extend its services to new devices. Device drivers in DOS are very simple. They just have their services exposed through the file system interface. What is a device driver?

Device driver file starts with a header containing a link to the next driver in the first four bytes followed by a device attribute word. The most important bit in the device attribute word is bit 15 which dictates if it is a character device or a block device.

If the bit is zero the device is a character device and otherwise a block device.

Next word in the header is the offset of a strategy routine, and then is the offset of the interrupt routine and then in one byte, the number of units supported is stored. This information is padded with seven zeroes.

Strategy routine is called whenever the device is needed

www.vchowk.com

it is passed a request header. Request header stores the unit requested, the command

code, space for return value and buffer pointers etc. Important command codes include 1. 2. 3. 4. 0 to initialize, 1 to check media, 2 to build a BIOS parameter block, 4 and 8 for read and write respectively.

For every command the first 13 bytes of request header are same.

Why are device drivers necessary, given that the BIOS already has code that communicates with the computer's hardware?

Ans: These are used for the reason of fast programming execution. device driver takes some RAM and expresses it as a secondary storage device to the operating system. Therefore a new drive is added and that can be browsed to, filed copied to and from just like ordinary drives expect that this drive is very fast as it is located in the RAM. This program cannot be directly executed since it is not a user program. This must be loaded by adding the line device=filename.sys in the config.sys file in the root directory.

Question No: 36

( M a r k s: 5 )

Write the code of break point interrupt routine.

Breakpoint interrupts service routine : debugISR: push bp

www.vchowk.com mov bp, sp push ax push bx push cx push dx push si push di push ds push es ; .to read cs, ip and flags

sti push cs pop ds

;.. waiting for keyboard interrupt

; initialize ds to data segment

mov ax, [bp+4] mov es, ax dec word [bp+2] mov di, [bp+2] ; .load interrupted segment in es ; .decrement the return address ; read the return address in di

mov word [opcodepos], di ;. remember the return position mov al, [opcode] mov [es:di], al ; ..load the original opcode ;.. restore original opcode there

mov byte [flag], 0 call clrscr

; set flag to wait for key

;. clear the screen

mov si, 6

; ..first register is at bp+6

www.vchowk.com mov cx, 12 mov ax, 0 mov bx, 5 ; total 12 registers to print ; ..start from row 0 ; .print at column 5

push ax push bx mov dx, [bp+si] push dx call printnum sub si, 2 inc ax loop l3

; ..row number ;. column number

;. number to be printed ;.. print the number ; .point to next register ; ..next row number ; .repeat for the 12 registers

mov ax, 0 mov bx, 0 mov cx, 12 mov si, 4 mov dx, names

; ..start from row 0 ; ..start from column 0 ; ..total 12 register names ;. each name length is 4 chars ; ..offset of first name in dx

push ax push bx push dx push si call printstr add dx, 4 inc ax

;. row number ; column number ; .offset of string ; .length of string ; .print the string ;.. point to start of next string ; new row number

www.vchowk.com loop l1 names ;.. repeat for 12 register

or word [bp+6], 0x0100 ; set TF in flags image on stack

keywait:

cmp byte [flag], 0 je keywait ;

;. has a key been pressed .. no, check again

pop es

pop ds pop di pop si pop dx pop cx pop bx pop ax pop bp iret

start:

xor ax, ax mov es, ax ; point es to IVT base

mov word [es:1*4], trapisr ;. store offset at n*4 mov [es:1*4+2], cs mov word [es:3*4], mov [es:3*4+2], cs ; ; ...store segment at n*4+2 ..debugisr ; store offset at n*4 ..store segment at n*4+2

www.vchowk.com cli ; .disable interrupts

mov word [es:9*4], kbisr ; .store offset at n*4 mov [es:9*4+2], cs sti ; ; ...store segment at n*4+2 enable interrupts

You might also like