shell - #ifndef _shell_ # #define _shell_ # include...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
#ifndef _shell_ #define _shell_ # # include "fs.cpp" # include "inout.cpp" # include "enigma.cpp" # include "rs232.cpp" //# include "splendor\desktop.cpp" //# include "run.c" # include "thd.cpp" # include "pm2.cpp" # define buff_limit 50 # define kill 1 # define reboot 2 # define FLOPPY 1 # define HARDD 2 extern "C" void run13(); char floppy_hardd_tog = FLOPPY; void change(char*); char *cprompt=" ##", *head=" MATRIX OPERATING SYSTEM", *path="A:\\"; int cmd=-1,cnt=0,mnt=0; //int ccs,cip; char cmd_buff[buff_limit][70],cmd_parser_buff[300]; char prompt(); void get_time(); void get_date(); int up(int,char*); int down(int,char*); int command(); void version(); void credits(); void help(); void dir(); void ls(); void shell(); void load(); void gui(); v void thread(void) ; v /* ---------------- RUN ______________*/ // void shell(); //void load(); extern "C" void run13(); int ccs,cip; int cret(); i void run()//run { //floppy reset---------- asm xor ah,ah; asm mov dl,0x00; asm int 0x13; //--------------------- / asm push si // req by tcc asm
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
asm push di //"" //asm pusha ccs=_CS; cip=(int)load; run13(); } cret() { asm pop ax asm pop ax asm pop di asm pop si //check return------------ asm mov ah , 0x09 asm mov al , 't' asm mov bh , 0 asm mov bl , 0x16 asm mov cx , 34 asm int 0x10 //--------------------------- / return 0; } /* ---------------- RUN ______________*/ //void gui(); / // To display the shell void shell() { x = 1; y = 3; clear(color(0,15)); setattrib(color(0,2)); printxy(head,1,1); drawhline(1,2,78,color(0,2)); cmd_parser_buff[0] = 0; } // To input and process command void load() { Error_Code = 0; char message = 0; while((message=prompt())!=0) { if(message==kill) { clear(color(0,15)); printxy("Terminating system ",1,1); printxy("Breaking to main(). .",1,2); break; } else if(message==reboot) { clear(color(0,15));
Background image of page 2
printxy("Terminating system ",1,1); printxy("Rebooting. .",1,2); mtx_reboot(); } else if(message==100) { error("Not A Valid Command. Type `help'."); putchar('\r'); } if(Error_Code) { switch(Error_Code) { case 1: error("File_Not_Found");break; case 2: error("Folder_Not_Found");break; case 3: error("Destination_File_Exist");break; case 4: error("Destination_Folder_Exist");break; case 5: error("Access_Violation");break; case 6: error("No_Disk_Space");break; case 7: error("Des_Path_Not_Exist");break; case 8: error("Hard_Disk_Not_Mounted");break; } putchar(13); Error_Code = 0; } } } // To input a command and return corresponding result char prompt() { char c = 0 , *cmdptr = cmd_buff[++cmd] ; int counter = 0,ix; setattrib(color(0,2)); //if(y>25) {x=1;y=3;} if( y>=24) { mtx_scrollup(1,0,3,79,24); y = 24; } printxy(path, x=1, y); x+=(unsigned int)strlen(path); putchar('@'); printxy(curr_user, x , y); x+=(unsigned int)strlen(curr_user); printxy(cprompt, x, y);
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/21/2011 for the course ECE 271 taught by Professor Eason,r during the Spring '08 term at University of Maine Orono .

Page1 / 13

shell - #ifndef _shell_ # #define _shell_ # include...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online