LD = $(CROSS_PREFIX)ld
CFLAGS = -g -c -fno-builtin -m32 -DBUILDER='"$(shell whoami)"'
-# æ\8c\87示ç¼\96è¯\91å\99¨ç\94\9fæ\88\90ä¸\8dä¾\9dèµ\96位置无关代码
+# æ\8c\87示ç¼\96è¯\91å\99¨ç¦\81æ¢ç\94\9fæ\88\90位置无关代码
CFLAGS += -fno-pic
# 指示编译器在生成目标文件时不省略函数调用栈帧指针: frame pointer
CFLAGS += -fno-omit-frame-pointer
void serial_write(const char *buf, size_t size);
-char pkbuf[1024];
+
extern tty_t *const default_tty;
int printk(const char *fmtstr, ...) {
- ENTER_CRITICAL_ZONE;
+ char pkbuf[1024];
+ // ENTER_CRITICAL_ZONE;
char *args = (char *)(((char *)&fmtstr) + 4);
int size = vsprintf(pkbuf, fmtstr, args);
tty_write(default_tty, pkbuf, (size_t)size);
serial_write(pkbuf, (size_t)size);
- EXIT_CRITICAL_ZONE;
+ // EXIT_CRITICAL_ZONE;
return 0;
}
extern tty_t *const debug_tty;
-char pdbuf[1024];
int printd(const char *fmtstr, ...) {
- ENTER_CRITICAL_ZONE;
+ char pdbuf[1024];
+ // ENTER_CRITICAL_ZONE;
char *args = (char *)(((char *)&fmtstr) + 4);
int size = vsprintf(pdbuf, fmtstr, args);
tty_write(debug_tty, pdbuf, (size_t)size);
serial_write(pdbuf, (size_t)size);
- EXIT_CRITICAL_ZONE;
+ // EXIT_CRITICAL_ZONE;
return 0;
}
-char plobuf[1024];
+
extern tty_t *const monitor_tty;
int printlo(unsigned int xpos, unsigned int ypos, const char *fmtstr, ...) {
- ENTER_CRITICAL_ZONE;
+ char plobuf[1024];
char *args = (char *)(((char *)&fmtstr) + 4);
int size = vsprintf(plobuf, fmtstr, args);
+
+ ENTER_CRITICAL_ZONE;
+
tty_write_at(monitor_tty, xpos, ypos, plobuf, (size_t)size);
EXIT_CRITICAL_ZONE;
current->priority = 7;
while (1) {
- sysc_wait(7);
+ sysc_wait(37);
uint64_t sect_nr = get_next_deubug_sect_nr();
memset(disk_buf1, 0, 512);
current->priority = 13;
while (1) {
- sysc_wait(7);
+ sysc_wait(73);
uint64_t sect_nr = get_next_deubug_sect_nr();
memset(disk_buf2, 0, 512);
disk_request_t r;