📄 kernel.h
字号:
/** Snixos Project version 1.0, 2003.6* (C) Copyright 2003,2004,2005 Jockeyson,KeqiangGao <Snallie@tom.com>* All Rights Reserved.* Distributed under the terms of the GNU General Public License.** This program is a free and open source software and you can redistribute * it and/or modify it under the terms of the GNU General Public License as* published by the Free Software Foundation. As no any liablity is assumed * for any incidental or consequential damages in connection with the * information or program fragments contained herein,so any exception arised* is at your own risk. It is ABSOLUTELY WITHOUT ANY WARRANTY.* Bug report please send to Snallie@tom.com .*//* kernel.h: header file exclusively used for kernel.c Author : Snallie@tom.com Time : 2003.6*/#ifndef _KERNEL_H#define _KERNEL_Hextern int eax_reg, ebx_reg, ecx_reg, edx_reg;extern int esi_reg, edi_reg;extern int esp_reg, ebp_reg;extern int eflag_reg, cs_reg, eip_reg;extern int ds_reg, es_reg, ss_reg, fs_reg, gs_reg;extern void initInterrupts();extern void shreg();extern long tickcount;extern void setPITspeed(int hz);extern void dump_heap();#define PROMPT "Snixos# "#define MAXCMDS 4*6+5#define HZK16SIZE 267616#define PYMBSIZE 23502#define KNLKEYBFLEN 128 /* kernel keyboard buffer length */char kb[KNLKEYBFLEN];int cmdIdx = 0; /* command buffer kb[] index for cmdLex *//* Definition of task table */typedef struct taskItem { int ax, bx, cx, dx; int si, di; int bp, sp; int flag, ip; short int cs, ds, es, ss, fs, gs; unsigned char state; int ksts; int cpuTicks; unsigned int pid; char taskName[10]; struct taskItem *nextTaskLink;} taskData;static taskData *task, *taskTail;taskData *curTask;typedef enum command { PS, VER, HELP, CLEAR, SHOWREG, CHART, BEEP, STOP, START, INSORT, BINSORT, FACTOR, HANOI, MDP, DIR, WRFILE, RDFILE, TYPE, DEL, COPY, LISTFAT, MYVM, D0, REBOOT, PLAY, DATE, SHCN,HISTORY, UNKNOWN, /* token type */ ID, NUM} commands;typedef struct cmdItem { char *cmdstr; commands cmdType; char *desc;} cmdTab;typedef struct tokenRec { commands tokenType; struct { char stringVal[64]; int numVal; } attribute;} tokenRecord;cmdTab cmdTabs[MAXCMDS] = { {"ps", PS, "process status"}, {"ver", VER, "snixos version and release"}, {"help", HELP, "this help page"}, {"clear", CLEAR, "clear screen"}, {"reg", SHOWREG, "show cpu register's value"}, {"chart", CHART, "output ascii table "}, {"beep", BEEP, "make speaker beep for 10ms"}, {"stop", STOP, "stop task n"}, {"start", START, "start task n"}, {"insort", INSORT, "insert sorting algorithm demo"}, {"binsort", BINSORT, "binary insert sorting algorithm demo"}, {"factor", FACTOR, "evaluation for n! , factor n "}, {"hanoi", HANOI, "hanoi recursive prog demo, hanoi n"}, {"dir", DIR, "list directory of FAT file system"}, {"wrfile", WRFILE, "Write a file to FAT file system"}, {"rdfile", RDFILE, "read a file from FAT file system"}, {"type", TYPE, "alias of rdfile"}, {"del", DEL, "delete a file from RAM disk, del filename"}, {"copy", COPY, "file copying in RAM disk, copy src dest"}, {"listfat", LISTFAT, "list FAT table (the leading 10%)"}, {"myvm", MYVM, "test MYVM assembler working performance: myvm src.vms"}, {"d0", D0, "ignite exception: divide by zero"}, {"reboot", REBOOT, "reboot computer"}, {"play", PLAY, "play music through speaker"}, {"date", DATE, "cmos date"}, {"shcn", SHCN, "show hzk16 font,syntax:shcn 16 1"}, {"history", HISTORY, "display command history"}, {"mdp", MDP, "memory dumping"}, {"u/a", UNKNOWN, ""} /* must reserved as the last item here */};tokenRecord cmdsRecd;tokenRecord *pcmdsRecd = &cmdsRecd;commands cmdLex(tokenRecord * pcmdsRecd);void task1();void task2();void ktask();void initTask();void newTask(unsigned int taskEntrance, char *taskname);void insertSort();void binsort();long int factors(int);void ver();void hanoi(int n, char from, char via, char to);void banner();void time(int *tm);void mkDemoFile();void doInitInts();static void reboot(void);void timeTask();void motion();void keyDeal(int pid, char *taskName);void putHz(int x, int y, char *font);void cnver();void printHZ(int x, int y, char *s, int mode);#endif /* _KERNEL_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -