What is System Programming?

What is System Programming?

#include void interrupt(*old)(); void interrupt newint9(); void main() { old = getvect(0x09); setvect(0x09,newint9); keep(0,1000); } void interrupt newint9() { if (inportb(0x60)==0x1F) { outportb(0x20,0x20); return; }

(*old)(); } #include void interrupt newint9() { void interrupt(*old)(); if (inportb(0x60)==0x1F) void interrupt { newint9(); i++; if (i<=5){ int i=1; outportb(0x20,0x20) return;

void main() } { i=1; old=getvect(0x09); } setvect(0x09,newint9 (*old)(); ); } keep(0,1000); } #include void interrupt(*old)(); void interrupt newint9();

char far *scr=(char far *) 0x00400017; void main() { old=getvect(0x09); setvect(0x09,newint9); keep(0,1000); } void interrupt newint9() { if((inportb(0x60)==83)&&((*scr)&12==12)) { outportb(0x20,0x20); return; } (*old)(); }

40:17H 0 0 0 0 1 1 0

Alt Pressed Ctrl Pressed 83 = Scan Code for Del 0 Keyboard Buffer Keyboard Buffer is located in BIOS Data Area. Starts at 40: IEH Ends at 40 : 3DH Has 32 byes of memory 2 bytes for each character. Head points is located at address 40 :

1A to 40 : IBH Tail points located at address 40 : IC to 40 : IDH 40:1AH 40:1CH Head Tail 40:1EH 40:3DH A 0

B 0 0 83 20 21 22 23 Head = 0x24 0xIE 0x20

B 0 0 83 Head = 24 So KBD buffer acts as a circular buffer. The taut value should be examination to get to the start of the buffer. #include void interrupt (*old)(); void interrupt new1(); char for *scr = (char far*) 0x0040001C;

void main() { old = getvect(0x09); setvect(0x09,new1); keep(0,1000); } void interrupt new1 () { if(inportb(0x60)==83) { *((char far*)0x0040000+*scr)=25; if((*scr)==60) *scr=30; else *scr+=2;

outportb(0x20,0x20); return; }} EOI Code for Slave IRQ For Master outportb(0x20,0x20); For Slave outportb(0x20,0x20); outportb(0xA0,0x20); OCW2*OCW3 7

6 5 4 3 2 X 1 X 00 If EOI is to be Initialized

001 FOR Non Specific EOI 01 If other Registers are to be accessed 0 X 7 6 5 4 3

2 0 1 0 01 To read IRR or ISR 10 = IRR 11= In-Service Register 7 0 6 0

5 0 No EOI relevant 4 0 3 1 2 0 1

0 Dont Care Other Register to be Accessed 0 0 7 0 6 0 5

0 4 0 3 1 2 0 1 1 0 0

IRR Accessed 01 PIC Notified about reading operation 7 0 6 0 5 0 4 0

3 1 2 0 1 1 0 1 ISR Accessed 01 PIC Notified about reading operation #include

#include #include void main ( ) { char a; outport(0x20,8); outport(0x20,0x0A); a=inport(0x20); printf (value of IRR is %x, a); outport(0x20,0x08); outport(0x20,0x0B); a=inport(0x20); printf (value of ISR is %x, a); } More about TSR Programs

A TSR need to be loaded once in memory Multiple loading will leave redundant copies in memory So we need to have some check which will load the program only once Using a Global Variable as a flag int flag; flag =1; Keep(0,1000); if (flag==1) Make TSR else

exit Program But this wont Work Answers is to use a memory area as flag that is global to all programs. i.e. IVT int 65 is empty, we can use its vector as a flag. Address of vector

seg = 0 offset = 65H * 4 #include #include #include unsigned int far * int65vec = (unsigned far *) MK_FP(0,0x65*4) void interrupt (*oldint) ( ); void interrupt newfunc ( ); void main() { if((*int65vec) = = 0xF00F) { oldint =getvect (0x08);

setvect(0x08, newint); (*int65vec) = 0xF00F; keep (0,1000); }else { puts (Program Already Resident); }} void interrupt newfunc () { ::::::: ::::::: (*oldint) ( ); }

But what if another program is resident or using this vector. Another Method Service # 0xFF usually does not exist for ISRs. Key is to create another service # 0xFF for the ISR interrupt besides other processing. #include #include #include void interrupt (*oldint) ( ); void interrupt newfunc ( unsigned int BP,..,flags); void main()

{ _DI = 0; _AH = 0xFF; geninterrupt (0x13); if (_DI = = 0xF00F) { puts (Program Already Resident); exit (0); } else { oldint = getvect (0x13); setvect (0x13, newint); Keep (0, 1000);

}} void interrupt newint ( ) { if (_AH == 0xFF){ DI = 0xF00F; return; }else { ::::::: ::::::: } (*oldint) ( ); }

Recently Viewed Presentations

  • ARDS - Treatment

    ARDS - Treatment

    PowerPoint Presentation PEEP setting Recruitment maneuvers Ventilator modes Inverse ratio ventilation (IRV) Prone ventilation PowerPoint Presentation PowerPoint Presentation PowerPoint Presentation PowerPoint Presentation PowerPoint Presentation PowerPoint Presentation Airway pressure release ventilation (APRV) PowerPoint Presentation ...
  • Cscd 218 : Data Communications and Networking 1

    Cscd 218 : Data Communications and Networking 1

    campus network. A . Metropolitan. Area Network (MAN), consists of a computer network across an entire city, college campus or small region. A MAN is larger than a LAN, which is typically limited to a single building or site. Depending...
  • Rapid Assessment Overview - Adjutant General of Kansas

    Rapid Assessment Overview - Adjutant General of Kansas

    Rapid Assessment A quick evaluation of a disaster/emergency impacted area Why is it Important? It provides the local government with accurate information for an adequate response to life-threatening situations A quick analysis of the potential hazard to critical infrastructure To...
  • Extension Cord Safety

    Extension Cord Safety

    EXTENSION CORD SAFETY. PPT-007-01. Bureau of Workers' Compensation . PA Training for Health & Safety (PATHS) "The U.S. Consumer Product Safety Commission (CPSC) estimates that each year, about 4,000 injuries associated with electric extension cords are treated in hospital emergency...
  • Canton Crossing Tower Baltimore, Maryland

    Canton Crossing Tower Baltimore, Maryland

    Canton Crossing Tower Baltimore, Maryland ... Site Logistics Foundation Proposal Designed Foundation Precast concrete piles with cast-in-place pile caps Proposed Foundation Cast-in-place caissons Reasons for Foundation Proposal Central Plant success Pile Driving Issues Delivery Issues and Barge ...
  • The Rise of Nationalism &amp; Sectionalism

    The Rise of Nationalism & Sectionalism

    The Rise of Nationalism & Sectionalism. Please pick up a copy of Focus #14: Sectionalism from the cart T. urn in Homework 7 to the box and take out Class Notes #14: The Rise of Nationalism
  • 2010 Ops Workshop - United States Coast Guard

    2010 Ops Workshop - United States Coast Guard

    No name tags, ribbons, devices or insignia Refer Coat and Overcoat are no longer authorized after 31 Dec 2012 2012 Operations Workshop Department of Response * Uniform Reminders Only one sew-on qualification insignia (coxswain, PWO, RBS, Trident, etc.) is authorized...
  • Hinduism, Buddhism, Taoism and New Age

    Hinduism, Buddhism, Taoism and New Age

    Taoism has the same problem of the impersonality of god in Hinduism. Tao is the creator of both good and evil. Instead of rescuing people from evil, he himself has created evil and furthermore has called people to bow down...