osdev

Booting a non-multiboot kernel with GRUB2 [closed]

天大地大妈咪最大 提交于 2019-12-01 07:19:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I want to boot a custom kernel (non-multiboot) with GRUB2, I've read that I need grub.cfg like this: menuentry "custom kernel" { set root=(hd0,0) chainloader +1 } So, I have some questions: How grub detect kernel? (with multiboot spec I used kernel /boot/kernel.bin ) How my kernel must look like (sorry for my

VirtualBox - No bootable medium found

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 04:15:10
问题 There are a lot of question on stackoverflow with the similar title. I read all of them, but none of them answers my problem. This is why I opened this question. I am creating an operating system in assembler and C. I found that I must compile C code to binary format, extract text section and save it as a file, then convert it to ISO, then mount it to virtual optical dive of diskete and then load my OS in VirtualBox. So, that is a lot of work I want to avoid. I don't want to convert my binary

Can't jump or call kernel loaded at 0x8000

南楼画角 提交于 2019-12-01 03:32:44
问题 I am trying to develop an operating system. The design is this: I have a bootloader loaded at 0x7c00 which loads the second stage and jumps to it at 0x7e00. The second stage is also in real mode and does a lot of stuff such as loading gdt, enabling A20 and switching to protected mode. It also loads a very simple 32 bit kernel at 0x8000. The problem now is that I am not able to call or jmp to 0x8000 as the kernel doesn't seem to get loaded(I did a memory dump in VirtualBox ). I have already

LD errors while linking 16-bit real mode code into a Multiboot compliant ELF executable

孤者浪人 提交于 2019-11-30 22:08:02
I'm writing a Multiboot compliant ELF executable containing my 32-bit kernel. My primary problem is that I'm receiving a series of linker errors while producing my executable: relocation truncated to fit: R_386_16 against `.text' Linker Script, Code and Build script below I have decided to try implementing VESA VBE graphics in my OS. I found an existing VESA driver in the OSDev forum and I tried to integrate it into my own OS. I tried adding it to my source directory, assembled it with NASM and linked it into a final executable with LD . The specific errors I received were: vesa.asm:(.text

Memory map shows more RAM than physically available

我的梦境 提交于 2019-11-30 19:54:16
I am working on a small x86 kernel. I am accessing and attempting to read the memory map that GRUB provides in the multiboot header. I have an Intel i3 cpu and 4 GiB of RAM. While running on this machine, I am reading the following memory map: --Base Address-- --Length-- --Type-- 0x0000000000000000 0x000000000009d000 0x1 0x000000000009d000 0x0000000000003000 0x2 0x00000000000e0000 0x0000000000020000 0x2 0x0000000000100000 0x00000000bb53f000 0x1 0x00000000bb63f000 0x0000000000080000 0x2 0x00000000bb6bf000 0x0000000000100000 0x4 0x00000000bb7bf000 0x0000000000040000 0x3 0x00000000bb7ff000

Creating a proper Task State Segment (TSS) structure with and without an IO Bitmap?

≡放荡痞女 提交于 2019-11-30 09:26:25
问题 Reading the documentation between Intel and AMD and looking at code makes it difficult at times to understand how to create a proper Task State Segment (TSS) that has no IO port bitmap (IOPB). There also seems to be confusion over creating a TSS with an IOPB as well since it seems ambiguous as to whether an IO Bitmap (IOPB) requires a trailing 0xff byte. I'm aware that there are is a dependency between the TSS and a TSS Descriptor (in the GDT). The TSS descriptor governs the base address of

OsDev syscall/sysret and sysenter/sysexit instructions enabling

六月ゝ 毕业季﹏ 提交于 2019-11-30 08:54:08
问题 I am building an 32 bit OS in assembly. I have setup the IDT and I am handling program interruptus through int instruction. How can I enable the syscall and sysenter instructions and how do I handle them/return? Is true that syscall instruction isn't supported in 32 bit by Intel processors so I can't use it? Is true that sysret instruction isn't safe? Do somewhere exist a tutorial for that? EDIT : My main question is how to enable the syscall and sysenter instructions! (No duplication) 回答1:

Displaying text video memory at 0xb8000 without using the C library

情到浓时终转凉″ 提交于 2019-11-30 07:39:05
I have been writing kernel in C. I've been using the GCC cross-compiler, writing on a Windows system and targeting 16bit Real Mode. I don't have the C library available to write the kernel. I have started with some code which is suppose to print a character directly to the screen. Here is a function from kernel.c : int main() { char *src = (char *)0xB8000000L; *src = 'M'; src += 2; *src = 'D'; return 0; } I compiled my code using GCC with the parameter -m16 to generate code that will run in real mode. I use these commands to generate my kernel.bin : gcc -ffreestanding -c -m16 kernel.c -o

Memory map shows more RAM than physically available

风格不统一 提交于 2019-11-30 04:41:06
问题 I am working on a small x86 kernel. I am accessing and attempting to read the memory map that GRUB provides in the multiboot header. I have an Intel i3 cpu and 4 GiB of RAM. While running on this machine, I am reading the following memory map: --Base Address-- --Length-- --Type-- 0x0000000000000000 0x000000000009d000 0x1 0x000000000009d000 0x0000000000003000 0x2 0x00000000000e0000 0x0000000000020000 0x2 0x0000000000100000 0x00000000bb53f000 0x1 0x00000000bb63f000 0x0000000000080000 0x2

For kernel/OS is C still it? [closed]

为君一笑 提交于 2019-11-29 22:26:29
I like operating systems and would eventually like to become a OS developer mostly working on kernels. In the future will C still be the language of choice and what else should I be trying to learn? I think it's safe to say that low-level parts of operating systems (e.g. the kernel) will continue to be written in C because of its speed. Like mentioned elsewhere, you will need to know assembler for certain parts of the kernel (something needs to load the kernel into memory). But you can work on the kernel with little or no assembly knowledge. A good example would be if you're implementing a