[metal] Push forward timing of VGA TTY initialization

- arrange to initialize the default VGA TTY data structure,
  at about the same time as the console stdin, stdout, &
  stderr descriptors are set up, rather than much later
This commit is contained in:
tkchia 2022-10-07 22:26:22 +00:00
parent 7d6835c0dd
commit bdd2d007cd
2 changed files with 8 additions and 1 deletions

View file

@ -91,5 +91,12 @@
vga_console: vga_console:
.endobj vga_console,globl,hidden .endobj vga_console,globl,hidden
.previous .previous
.init.start 305,_init_vga
push %rdi
push %rsi
call _vga_init
pop %rsi
pop %rdi
.init.end 305,_init_vga
.yoink sys_writev_vga .yoink sys_writev_vga
.yoink sys_readv_vga .yoink sys_readv_vga

View file

@ -60,7 +60,7 @@ void _vga_reinit(struct Tty *tty, unsigned short starty, unsigned short startx,
chr_ht, chr_wid, vid_buf, init_flags); chr_ht, chr_wid, vid_buf, init_flags);
} }
__attribute__((__constructor__)) static textstartup void _vga_init(void) { textstartup void _vga_init(void) {
if (IsMetal()) { if (IsMetal()) {
struct mman *mm = (struct mman *)(BANE + 0x0500); struct mman *mm = (struct mman *)(BANE + 0x0500);
unsigned short starty = mm->pc_video_curs_info.y, unsigned short starty = mm->pc_video_curs_info.y,