mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-09 07:06:47 +00:00
增加了uart输出的条件编译
This commit is contained in:
parent
22359344e4
commit
0e8bf69d65
3
.vscode/c_cpp_properties.json
vendored
3
.vscode/c_cpp_properties.json
vendored
@ -6,7 +6,8 @@
|
|||||||
"${workspaceFolder}/**"
|
"${workspaceFolder}/**"
|
||||||
],
|
],
|
||||||
"defines": [
|
"defines": [
|
||||||
"x86_64"
|
"x86_64",
|
||||||
|
"DEBUG"
|
||||||
],
|
],
|
||||||
"compilerPath": "/usr/bin/gcc",
|
"compilerPath": "/usr/bin/gcc",
|
||||||
"cStandard": "gnu17",
|
"cStandard": "gnu17",
|
||||||
|
@ -7,7 +7,13 @@ DIR_LIB=lib
|
|||||||
lib_patterns := *.a
|
lib_patterns := *.a
|
||||||
LIB_FILES := $(foreach DIR,$(DIR_LIB),$(addprefix $(DIR)/,$(lib_patterns)))
|
LIB_FILES := $(foreach DIR,$(DIR_LIB),$(addprefix $(DIR)/,$(lib_patterns)))
|
||||||
|
|
||||||
CFLAGS := -mcmodel=large -fno-builtin -m64 -g -O0 -I . -fno-stack-protector
|
DEBUG=1
|
||||||
|
CFLAGS := -mcmodel=large -fno-builtin -m64 -O0 -I . -fno-stack-protector
|
||||||
|
|
||||||
|
ifeq ($(DEBUG), 1)
|
||||||
|
CFLAGS += -g
|
||||||
|
endif
|
||||||
|
|
||||||
ARCH=x86_64
|
ARCH=x86_64
|
||||||
# 控制操作系统使用的中断控制器 _INTR_8259A_ _INTR_APIC_
|
# 控制操作系统使用的中断控制器 _INTR_8259A_ _INTR_APIC_
|
||||||
PIC := _INTR_APIC_
|
PIC := _INTR_APIC_
|
||||||
|
@ -115,13 +115,17 @@ void auto_newline()
|
|||||||
|
|
||||||
if (pos.x > pos.max_x)
|
if (pos.x > pos.max_x)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
uart_send(COM1, '\n');
|
uart_send(COM1, '\n');
|
||||||
|
#endif
|
||||||
pos.x = 0;
|
pos.x = 0;
|
||||||
++pos.y;
|
++pos.y;
|
||||||
}
|
}
|
||||||
if (pos.y > pos.max_y)
|
if (pos.y > pos.max_y)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
uart_send(COM1, '\n');
|
uart_send(COM1, '\n');
|
||||||
|
#endif
|
||||||
pos.y = pos.max_y;
|
pos.y = pos.max_y;
|
||||||
int lines_to_scroll = 1;
|
int lines_to_scroll = 1;
|
||||||
scroll(true, lines_to_scroll * pos.char_size_y, false);
|
scroll(true, lines_to_scroll * pos.char_size_y, false);
|
||||||
@ -630,8 +634,10 @@ static void putchar(uint *fb, int Xsize, int x, int y, unsigned int FRcolor, uns
|
|||||||
* @param BKcolor 背景颜色
|
* @param BKcolor 背景颜色
|
||||||
* @param font 字符的bitmap
|
* @param font 字符的bitmap
|
||||||
*/
|
*/
|
||||||
// 输出到串口
|
|
||||||
|
#ifdef DEBUG
|
||||||
uart_send(COM1, font);
|
uart_send(COM1, font);
|
||||||
|
#endif
|
||||||
|
|
||||||
unsigned char *font_ptr = font_ascii[font];
|
unsigned char *font_ptr = font_ascii[font];
|
||||||
unsigned int *addr;
|
unsigned int *addr;
|
||||||
|
@ -84,7 +84,9 @@ void system_initialize()
|
|||||||
|
|
||||||
// 初始化printk
|
// 初始化printk
|
||||||
printk_init(8, 16);
|
printk_init(8, 16);
|
||||||
|
#ifdef DEBUG
|
||||||
uart_init(COM1, 115200);
|
uart_init(COM1, 115200);
|
||||||
|
#endif
|
||||||
kinfo("Kernel Starting...");
|
kinfo("Kernel Starting...");
|
||||||
// 重新加载gdt和idt
|
// 重新加载gdt和idt
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user