Add Syscall: Exit, PutChar, GetCar, PutString, GetString
This commit is contained in:
parent
6f405265a5
commit
80fc250109
15 changed files with 359 additions and 17 deletions
25
code/userprog/consoledriver.h
Normal file
25
code/userprog/consoledriver.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#ifdef CHANGED
|
||||
#ifndef CONSOLEDRIVER_H
|
||||
#define CONSOLEDRIVER_H
|
||||
|
||||
#include "copyright.h"
|
||||
#include "utility.h"
|
||||
#include "console.h"
|
||||
|
||||
class ConsoleDriver:dontcopythis {
|
||||
public:
|
||||
// initialize the hardware console device
|
||||
ConsoleDriver(const char *readFile, const char *writeFile);
|
||||
|
||||
~ConsoleDriver(); // clean up
|
||||
|
||||
void PutChar(int ch); // Behaves like putchar(3S)
|
||||
int GetChar(); // Behaves like getchar(3S)
|
||||
|
||||
void PutString(const char *s); // Behaves like fputs(3S)
|
||||
void GetString(char *s, int n); // Behaves like fgets(3S)
|
||||
private:
|
||||
Console *console;
|
||||
};
|
||||
#endif // CONSOLEDRIVER_H
|
||||
#endif // CHANGED
|
Loading…
Add table
Add a link
Reference in a new issue