osdev

Virtualbox debugging — g: error: The VM is already running

雨燕双飞 提交于 2021-01-29 17:55:43
问题 I'm trying to debug an operating system that I am developing. When I start up the VM machine with VirtualBoxVM --startvm "X" --debug the VM starts paused, but when I execute the 'g' command to continue execution I get this error: g: error: The VM is already running But when I start my virtual machine without --debug , everything works fine, but I can't debug. Why does that error message appear? The VM starts stopped, so the message doesn't make sense and it doesn't allow me to debug my OS. 来源

How to convert ld -Ttext option to a linker script?

一个人想着一个人 提交于 2021-01-29 03:02:58
问题 I've found this tutorial on creating an operating system, and I'm trying to convert the linking part in the make file into a linker script. Here is the tutorial: https://github.com/ghaiklor/ghaiklor-os-gcc Here is the make file: SOURCES = $(shell find cpu drivers include kernel libc -name '*.c') HEADERS = $(shell find cpu drivers include kernel libc -name '*.h') OBJ = ${SOURCES:.c=.o cpu/interrupt.o} ASM = nasm CC = gcc LD = ld -m elf_i386 CFLAGS = -g -ffreestanding -Wall -Wextra -fno

How to convert ld -Ttext option to a linker script?

大城市里の小女人 提交于 2021-01-29 03:02:15
问题 I've found this tutorial on creating an operating system, and I'm trying to convert the linking part in the make file into a linker script. Here is the tutorial: https://github.com/ghaiklor/ghaiklor-os-gcc Here is the make file: SOURCES = $(shell find cpu drivers include kernel libc -name '*.c') HEADERS = $(shell find cpu drivers include kernel libc -name '*.h') OBJ = ${SOURCES:.c=.o cpu/interrupt.o} ASM = nasm CC = gcc LD = ld -m elf_i386 CFLAGS = -g -ffreestanding -Wall -Wextra -fno

What causes “x.asm:(.text+0xd): undefined reference to `y'”?

我们两清 提交于 2021-01-27 16:12:51
问题 For a long time I had not programmed with C and Assembler (about 2 years). Now I have decided to start again but I would like to do something much more complicated. I thought about creating a simple kernel. Now I found this source code on the internet: boot.asm: global loader extern kernel_main MAGIC equ 0xbad FLAGS equ 0x3 CHECKSUM equ -(MAGIC+FLAGS) section .text align 4 dd MAGIC dd FLAGS dd CHECKSUM loader: call kernel_main cli quit: hlt jmp quit kernel.c: void print(char *text) { char

What causes “x.asm:(.text+0xd): undefined reference to `y'”?

心不动则不痛 提交于 2021-01-27 16:10:43
问题 For a long time I had not programmed with C and Assembler (about 2 years). Now I have decided to start again but I would like to do something much more complicated. I thought about creating a simple kernel. Now I found this source code on the internet: boot.asm: global loader extern kernel_main MAGIC equ 0xbad FLAGS equ 0x3 CHECKSUM equ -(MAGIC+FLAGS) section .text align 4 dd MAGIC dd FLAGS dd CHECKSUM loader: call kernel_main cli quit: hlt jmp quit kernel.c: void print(char *text) { char

What causes “x.asm:(.text+0xd): undefined reference to `y'”?

匆匆过客 提交于 2021-01-27 15:52:24
问题 For a long time I had not programmed with C and Assembler (about 2 years). Now I have decided to start again but I would like to do something much more complicated. I thought about creating a simple kernel. Now I found this source code on the internet: boot.asm: global loader extern kernel_main MAGIC equ 0xbad FLAGS equ 0x3 CHECKSUM equ -(MAGIC+FLAGS) section .text align 4 dd MAGIC dd FLAGS dd CHECKSUM loader: call kernel_main cli quit: hlt jmp quit kernel.c: void print(char *text) { char

What causes “x.asm:(.text+0xd): undefined reference to `y'”?

限于喜欢 提交于 2021-01-27 14:57:16
问题 For a long time I had not programmed with C and Assembler (about 2 years). Now I have decided to start again but I would like to do something much more complicated. I thought about creating a simple kernel. Now I found this source code on the internet: boot.asm: global loader extern kernel_main MAGIC equ 0xbad FLAGS equ 0x3 CHECKSUM equ -(MAGIC+FLAGS) section .text align 4 dd MAGIC dd FLAGS dd CHECKSUM loader: call kernel_main cli quit: hlt jmp quit kernel.c: void print(char *text) { char

Bootloader is Not loading the kernel

江枫思渺然 提交于 2021-01-24 10:56:47
问题 I am developing my Operating System. I got error on booting my OS. The error was: KERNEL.BIN not found! Here are the Codes: Boot.asm ; The Aqua_Seven_OS Operating System bootloader ; ================================================================== BITS 16 jmp short bootloader_start ; Jump past disk description section nop ; Pad out before disk description ; ------------------------------------------------------------------ ; Disk description table, to make it a valid floppy ; Note: some of

Should using MOV instruction to set SS to 0x0000 cause fault #GP(0) in 64-bit mode?

天涯浪子 提交于 2021-01-19 21:18:53
问题 This question is inspired by a Reddit question in r/osdev except that this question focuses on the SS register. One may say RTFM (ISA entry for MOV), but when this question comes up it can get varying answers even among OS developers. Question : Should using the MOV instruction to set SS to 0x0000 cause a general protection fault #GP(0) in 64-bit mode? For example: If I am in 64-bit mode with a Current Privilege level (CPL) of 0, should I expect to see a #GP(0) with this code snippet: NULL

Should using MOV instruction to set SS to 0x0000 cause fault #GP(0) in 64-bit mode?

半城伤御伤魂 提交于 2021-01-19 21:18:33
问题 This question is inspired by a Reddit question in r/osdev except that this question focuses on the SS register. One may say RTFM (ISA entry for MOV), but when this question comes up it can get varying answers even among OS developers. Question : Should using the MOV instruction to set SS to 0x0000 cause a general protection fault #GP(0) in 64-bit mode? For example: If I am in 64-bit mode with a Current Privilege level (CPL) of 0, should I expect to see a #GP(0) with this code snippet: NULL