FAQ Database Discussion Community


C++ add up all bytes in a structure

c++,struct,osdev
Given a packed struct like this: struct RSDPDescriptor { char Signature[8]; uint8_t Checksum; char OEMID[6]; uint8_t Revision; uint32_t RsdtAddress; } __attribute__ ((packed)); How can I sum all of the individual bytes in it?...

Using pointer as an array - C

c,arrays,pointers,types,osdev
I found in C code at this page: uint16_t* terminal_buffer; What does it mean? Is it the same as uint16_t *terminal_buffer;? Than variable terminal_buffer is accesed like an array: terminal_buffer[index] = make_vgaentry(' ', terminal_color); Can somebody explain me how it works? Thanks....

MinGW's ld cannot perform PE operations on non PE output file

gcc,assembly,mingw,nasm,osdev
I know there are some other similar questions about this out there, be it StackOverflow or not. I've researched a lot for this, and still didn't find a single solution. I'm doing an operative system as a side project. I've been doing all in Assembly, but now I wanna join...

Compiling custom kernel for HP Thin client and creating bootable ISO with grub

c,osdev,grub,thin-client
I made simple OS with one really nice library, I compiled everything, reallocated (I want) and finaly created kernel. I successfully ran it on qemu-system-i386. Plus created ISO with grub and boot it via virtualbox. Everything worked, output was OK. So, I copied it to usb (dd if=bin/os.iso of=/dev/sdd1) and...

Strange behaviour of C pointers with memory mapped I/O

c,pointers,kernel,osdev
I am currently working on writing a basic operating system as a learning project. I use a gcc 4.9.2 cross compiler for this purpose. When trying to use memory-mapped I/O I stumbled upon behaviour of C pointers (or possibly memory-mapped I/O) which I fail to understand. When directly accessing the...

Rustc/LLVM generates faulty code for aarch64 with opt-level=0

rust,qemu,arm64,osdev
I have two files which are assembled/compiled/linked into minimalistic kernel. start.s: .set CPACR_EL1_FPEN, 0b11 << 20 .set BOOT_STACK_SIZE, 8 * 1024 .global __boot_stack .global __start .global __halt .bss .align 16 __boot_stack: .fill BOOT_STACK_SIZE .text __start: /* disable FP and SIMD traps */ mov x0, #CPACR_EL1_FPEN msr cpacr_el1, x0 /* set...

How to get Keyboard inputs into a kernel?

c,keyboard,kernel,osdev
I am writing my own kernel in c OS. Now I want to code a Console to interact with the Kernel. It should work like the normal Terminal on Linux. How can I get a input over the Keyboard (an example would be nice) Thanks for Help.

GCC 5.1.0-4 cross compiler build fail

gcc,osdev
I'm following the osdev.org bare metal tutorial, and I'm currently stuck at the cross compiler.! I'm building from an arch distro. It looks like it might be a problem with isl. I think the tutorial is based on an older version of gcc, cloog, isl, etc, so after a few...

Do I have to link the files with -lgcc?

c,gcc,osdev
If you've ever linked a kernel with gcc you may know the parameter -lgcc. Is this parameter important ? Thanks for a fast answer.