From 57704ff8dd41f308c34a95fe5b9c1dff9eb4d023 Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Sat, 14 Jan 2023 12:12:26 +0400 Subject: [PATCH] Rule for ejudge.sh; fix declaration of video_memory. --- Makefile | 4 ++++ drivers/vga.c | 2 ++ drivers/vga.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ec27cdb..bc289ee 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,10 @@ run: image.bin run-nox: image.bin qemu-system-i386 -nographic -drive format=raw,file=$< -serial mon:stdio +ejudge.sh: image.bin + echo >$@ "#!/bin/sh\nexec qemu-system-i386 -nographic -drive format=raw,file=$< -serial mon:stdio" + chmod +x $@ + debug-boot-nox: image.bin mbr.elf qemu-system-i386 -nographic -drive format=raw,file=$< -s -S & $(GDB) mbr.elf \ diff --git a/drivers/vga.c b/drivers/vga.c index 5a605cd..274a653 100644 --- a/drivers/vga.c +++ b/drivers/vga.c @@ -1,6 +1,8 @@ #include "port.h" #include "vga.h" +char* const video_memory = (char*) 0xb8000; + static unsigned char get_color(unsigned char fg, unsigned char bg) { return (bg << 4) + fg; } diff --git a/drivers/vga.h b/drivers/vga.h index dc21424..9307fa6 100644 --- a/drivers/vga.h +++ b/drivers/vga.h @@ -1,6 +1,6 @@ #pragma once -static char* const video_memory = (char*) 0xb8000; +extern char* const video_memory; enum { ROWS = 25,