FAQ Database Discussion Community

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

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?

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.

Strange behaviour of C pointers with memory mapped I/O

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...

Do I have to link the files with -lgcc?

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

GCC 5.1.0-4 cross compiler build fail

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...

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

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...

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

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...

Using pointer as an array - C

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....

C++ add up all bytes in a structure

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?...