CS401 Final Term 2010 Solved Spring
CS401 Final Term 2010 Solved Spring
com
Question No: 1
( M a r k s: 1 )
http://vuzs.net
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
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.
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
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
Question No: 8
( M a r k s: 1 )
http://vuzs.net
Question No: 9
( 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
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
( M a r k s: 1 )
http://vuzs.net
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
www.vchowk.com
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
www.vchowk.com 7
Question No: 21
( M a r k s: 1 )
http://vuzs.net
Question No: 22
( M a r k s: 1 )
http://vuzs.net
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 )
Ans:
( 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
Ans;
14 - SERIAL - READ CHARACTER FROM PORT
Question No: 30
( M a r k s: 2 )
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 )
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 )
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.
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.
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 )
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
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 si, 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
;. 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
;. row number ; column number ; .offset of string ; .length of string ; .print the string ;.. point to start of next string ; new row number
keywait:
pop es
start:
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
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