forked from metaverse/kernel-dev
Compare commits
3 Commits
2144ad5123
...
5dc9de8195
Author | SHA1 | Date |
---|---|---|
pointer-to-bios | 5dc9de8195 | |
pointer-to-bios | 4c923941eb | |
pointer-to-bios | ba6e23ee99 |
|
@ -99,8 +99,8 @@ tty **tty_get(usize id);
|
|||
|
||||
/**
|
||||
* @brief 获取tty的id
|
||||
*
|
||||
* @return usize
|
||||
*
|
||||
* @return usize
|
||||
*/
|
||||
usize tty_get_id(tty *__tty);
|
||||
|
||||
|
@ -121,6 +121,16 @@ void tty_set_framebuffer(tty *ttyx, framebuffer *fb);
|
|||
void tty_text_print(tty *ttyx, char *string, u32 color, u32 bgcolor);
|
||||
|
||||
#define gen_color(r, g, b) (((r) << 16) | ((g) << 8) | (b))
|
||||
#define WHITE gen_color(0xee, 0xee, 0xee)
|
||||
#define BLACK gen_color(0, 0, 0)
|
||||
#define RED gen_color(0xee, 0x22, 0x22)
|
||||
#define GREEN gen_color(0x22, 0xee, 0x22)
|
||||
#define BLUE gen_color(0x22, 0x22, 0xee)
|
||||
#define YELLOW gen_color(0xee, 0xee, 0x22)
|
||||
#define ORANGE gen_color(0xee, 0xaa, 0x22)
|
||||
#define PURPLE gen_color(0xee, 0, 0xee)
|
||||
#define PINK gen_color(0xee, 0x44, 0x66)
|
||||
#define GRAY gen_color(0xaa, 0xaa, 0xaa)
|
||||
|
||||
usize tty_get_width(tty *ttyx);
|
||||
usize tty_get_height(tty *ttyx);
|
||||
|
@ -132,8 +142,8 @@ bool tty_is_enabled(tty *ttyx);
|
|||
|
||||
/**
|
||||
* @brief 打开某个tty
|
||||
*
|
||||
* @param ttyx
|
||||
*
|
||||
* @param ttyx
|
||||
* @return true 打开成功
|
||||
* @return false 已经打开
|
||||
* 或作为raw_framebuffer类型的tty,framebuffer已被其它raw_framebuffer
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import time
|
||||
|
||||
curtime = str(int(time.time() * 1000))
|
||||
|
||||
print(curtime)
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
ARCH := $(shell uname -m)
|
||||
PWD := $(shell pwd)
|
||||
SOURCE := ${PWD}/scripts
|
||||
SOURCE := ${PWD}/../scripts
|
||||
ifeq (${ARCH},x86_64)
|
||||
ASM = nasm
|
||||
ASMFLAGS = -f elf64
|
||||
|
@ -12,7 +12,7 @@ ifdef release
|
|||
release = 1
|
||||
endif
|
||||
|
||||
ALLOCATOR_MAGIC = $(shell doas hwclock | sha512sum | head -c 128 | md5sum | head -c 8)
|
||||
ALLOCATOR_MAGIC = $(shell "${SOURCE}/magicgen" | sha512sum | head -c 128 | md5sum | head -c 8)
|
||||
|
||||
SUBOBJS = kernel/kernel.o libk/libk.o rust.o
|
||||
|
||||
|
@ -58,6 +58,8 @@ metaverse.elf: kernel libk rust metaverse.lds
|
|||
.PHONY: kernel libk all clear postproc rust
|
||||
|
||||
all: postproc metaverse.elf
|
||||
@echo -e "Build \e[1;32msucceeded\e[0m."
|
||||
@echo -e "Build ID \e[1;31m$(shell "${SOURCE}/magicgen"|sha512sum|head -c 128|md5sum|head -c 8)\e[0m."
|
||||
|
||||
postproc:
|
||||
@echo -n -e "\e[36m"
|
||||
|
|
|
@ -58,8 +58,8 @@ void tty_set_framebuffer(tty *ttyx, framebuffer *fb)
|
|||
ttyx->height = ttyx->typeinfo.raw_framebuffer.height;
|
||||
if (ttyx->mode == tty_mode_text)
|
||||
{
|
||||
ttyx->text.width = fb->width / tty_get_font()->char_width;
|
||||
ttyx->text.height = fb->height / tty_get_font()->char_height;
|
||||
ttyx->text.width = fb->width / (TTY_FONT_SCALE * tty_get_font()->char_width);
|
||||
ttyx->text.height = fb->height / (TTY_FONT_SCALE * tty_get_font()->char_height);
|
||||
ttyx->text.line = 0;
|
||||
ttyx->text.column = 0;
|
||||
}
|
||||
|
|
|
@ -150,10 +150,11 @@ impl Color {
|
|||
pub const RED: Color = Color(0xee, 0x22, 0x22);
|
||||
pub const GREEN: Color = Color(0x22, 0xee, 0x22);
|
||||
pub const BLUE: Color = Color(0x22, 0x22, 0xee);
|
||||
pub const YELLOW: Color = Color(0xee, 0x22, 0x22);
|
||||
pub const ORANGE: Color = Color(0xee, 0xee, 0x22);
|
||||
pub const PURPLE: Color = Color(0xee, 0, 0xee);
|
||||
pub const YELLOW: Color = Color(0xee, 0xee, 0x22);
|
||||
pub const ORANGE: Color = Color(0xee, 0xaa, 0x22);
|
||||
pub const PURPLE: Color = Color(0xee, 0x22, 0xee);
|
||||
pub const PINK: Color = Color(0xee, 0x44, 0x66);
|
||||
pub const GRAY: Color = Color(0xaa, 0xaa, 0xaa);
|
||||
}
|
||||
|
||||
impl From<Color> for u32 {
|
||||
|
|
Loading…
Reference in New Issue