Yêu cầu kỹ thuật - ngankhanh98/nachos GitHub Wiki
Nachos
Not Another Completely Heuristic Operating System
To-do tasks:
- 9. Viết chương trình echo, mỗi khi nhập một dòng từ console thì console xuất lại dòng đó
- 10. Viết chương trình cat , yêu cầu nhập vô filename, rồi hiển thị nội dung của file đó
- 11. Viết chương trình copy, yêu cầu nhập tên file nguồn và file đích và thực hiện copy
Supported Function:
int CreateFile(char *name);
input: filename (char*) purpose: create a new file output: 0 - succeed, -1 - if not
OpenFileId Open(char *name, int type)
input: filename (char*); type: 0 - readable & writeable, 1 - read-only purpose: open a file in fileSystem output: 0 - succeed, -1 - if not
int Read(char *buffer, int size, OpenFileId id);
input: filename (char*), size of string (int), file id (OpenFileId) purpose: read from file, store into char* buffer output: 0 - succeed, -1 - if not
int Write(char *buffer, int size, OpenFileId id);
input: string (char*), size of string (int), id of file (OpenFileId) purpose: copy string to file output: 0 - succeed, -1 - if not
int CloseFile(OpenFileId id);
input: file id (OpenFileId) ; purpose: close a file in fileSystem output: 0 - succeed, -1 - if not
int Seek(int pos, OpenFileId id);
input: expecting position (int), file id; pos=-1: length of file; purpose: move FILE pointer to place you wish output: 0 - succeed, -1 - if not
void Print(char *buffer);
like printf("Hello world!");
void Scan(char* buffer, int length);
like scanf("%s", buffer);