Skip to content

Commit

Permalink
Merge pull request #82 from bassaer/fix-qemu
Browse files Browse the repository at this point in the history
Fix qemu
  • Loading branch information
bassaer committed Mar 18, 2022
2 parents 3625705 + ff5cfc5 commit f7ffc97
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## ver 2.0.2
- fix qemu option
- fix dir name

## ver 2.0.1
- fix paging
- fix itoa
Expand Down
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ IMG = myos-$(VER).img
all: package

prepare:
sudo apt install -y mtools qemu gcc-mingw-w64-x86-64 ovmf
sudo apt install -y mtools qemu gcc-mingw-w64-x86-64 ovmf qemu-system-x86

kernel/vmmyos: window
kernel/vmmyos: graphics
@$(MAKE) build -C kernel

arch/x86/BOOTX64.EFI: lib
Expand All @@ -27,20 +27,21 @@ font:
lib:
@$(MAKE) -C lib

window:
@$(MAKE) -c window
graphics:
@$(MAKE) -c graphics

run: img
qemu-system-x86_64 -name myos \
-localtime \
-monitor stdio \
-bios /usr/share/ovmf/OVMF.fd \
-net none \
-usbdevice disk::$(IMG) \
-drive format=raw,file=$(IMG) \
-device nec-usb-xhci,id=xhci \
-device usb-mouse \
-device usb-kbd \
-d guest_errors \
|| true


usb: arch/x86/BOOTX64.EFI kernel/vmmyos
sudo mount /dev/sda /mnt
sudo rm -rf /mnt/EFI
Expand All @@ -59,4 +60,4 @@ clean:
@$(MAKE) clean -C arch/x86
@$(MAKE) clean -C kernel
@$(MAKE) clean -C lib
@$(MAKE) clean -C window
@$(MAKE) clean -C graphics
2 changes: 1 addition & 1 deletion window/Makefile → graphics/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CC = gcc
INCLUDE = -I../include -I../include/window
INCLUDE = -I../include -I../include/graphics
CFLAGS = -c -Wall -Wextra $(INCLUDE) -nostdlib -fno-builtin -fPIE

WIN_OBJ = cursor.o \
Expand Down
4 changes: 2 additions & 2 deletions window/cursor.c → graphics/cursor.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <window/cursor.h>
#include <window/desktop.h>
#include <graphics/cursor.h>
#include <graphics/desktop.h>

#define CURSOR_WIDTH 16

Expand Down
6 changes: 3 additions & 3 deletions window/desktop.c → graphics/desktop.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <window/cursor.h>
#include <window/desktop.h>
#include <window/font.h>
#include <graphics/cursor.h>
#include <graphics/desktop.h>
#include <graphics/font.h>

#include <stdarg.h>
#include <lib/string.h>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions kernel/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CC = gcc
INCLUDE = -I../include -I../window/include
INCLUDE = -I../include -I../graphics/include
CFLAGS = -c -Wall -Wextra $(INCLUDE) -nostdlib -fno-builtin -fPIE
KERN_OBJ = main.o
WIN_OBJ = ../window/desktop.o \
../window/cursor.o
WIN_OBJ = ../graphics/desktop.o \
../graphics/cursor.o

LIB_OBJ = ../lib/string.o

Expand Down
2 changes: 1 addition & 1 deletion kernel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*---------------------------*/

#include <uefi.h>
#include <window/desktop.h>
#include <graphics/desktop.h>

void kernel_main(BootInfo *boot) {
init_desktop(boot);
Expand Down
2 changes: 2 additions & 0 deletions scripts/changelog.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# This script needs gawk not mawk.

function usage {
cat <<EOF
Usage: $(basename "$0") [OPTION]...
Expand Down
2 changes: 1 addition & 1 deletion scripts/font.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def main():
data = read(args.f).split()
parsed = parse(data)
header = build(parsed)
write('./include/window/font.h', header)
write('./include/graphics/font.h', header)


if __name__ == '__main__':
Expand Down

0 comments on commit f7ffc97

Please sign in to comment.