Category: Kernel

Fixed one important bug in grub

I am doing kernel development in mac, my kernel is loaded up by grub because it relay on multiboot spec. I was unable to install grub in a loopback device on mac, so my mac is running a small linux vm in virtual box, i write a simple php to let me upload my kernel,…
Read more


2015/11/14 0

just bought stm32 nucleo

just bought stm32 nucleo, learning Cortex-M. But my final target is Cortex-A, i am more interesting in general-OS than rtos.


2015/11/11 0

newlib linker script summary for you own executable

After i build my newlib by “../newlib-2.1.0/configure –target=$TARGET –prefix=$PREFIX”, except the libc.a and crt0.o, i got these linker scripts. I am still thinking which one i should use for my own executables in my OS. elf_i386.x Default linker script, for normal executables elf_i386.xbn Script for -N: mix text and data on same page; don’t align…
Read more


2015/10/23 0

YEAH, page tables is ok now

After 100 times of failure, i finally loaded a exe into an independent address space (independent page tables and LDT). I meet all kind of failures: wrong page directory, wrong page table, wrong virtual address mapping, wrong code selector, wrong LDT, etc…


2015/10/22 1

A guide to how the FreeBSD kernel manages the IA32 processors in Protected Mode

Download : A guide to how the FreeBSD kernel manages the IA32 processors in Protected Mode


2015/09/29 0

Kernel can load up all segments to correct v-addr and p-addr now

Kernel can load up all segments to correct v-addr and p-addr now


2015/09/29 0

ported libelf

finally ported libel to my os, my linker script won’t warn me I crossed the kernel boundary. So libelf’s variables becoming exist in a memory area that they shouldn’t be there.


2015/09/13 0

handling exception 7

the easiest way to handle exception 7 is to execute clts then iret. My kernel was crashed because it generated a exception 0x7.


2015/08/19 0

libelf include issue

When you meet this: Just comment out the following line in /toolchain/include/libelf/sys_elf.h When I build the libelf in mac and in linux, the output sys_elf.h is different, in mac, the above line is not exist, so my OS is able to compile. Peter.


2015/06/30 0

I should look at this

I should look at this printf -> _fstat -> _sbrk -> write


2015/02/07 0

libelf.h has bug, it includes a missing header file

I cross compile the libel 0.8.13 on my ubuntu 12.04lts. I used the below command to configure it. The compile process is success and installed it correct. But inside the include/libelf/sys_elf.h, it includes a missing header file (elf.h). Just comment it out, and it will works.


2014/08/23 0

Adding file to newlib’s sys folder and make it compile

Adding file to newlib’s sys folder and make it compile, you need to modify the Makefile.in, see below


2014/08/16 0

newlib sys/*.h will not be copied to output directory

All the .h file in the sys directory will be included when compiling the files in your sys/XXX. They (sys/*.h) will not be copied to the output directoy, that mean they are just used for compile only.


2014/08/09 1

How to use PFSBuilder

How to use PFSBuilder This tutorial work in windows/linux/mac Step 1) Download the jar https://www.dropbox.com/s/do0ygc4z9dbxlwx/PFSBuilder-20140619.jar Step 2) make sure you have java in your PC Compress directory into PFS image Step 1) Make sure PFSBuilder.jar is in your current directory Step 2) Create a folder call “input” and put some files and directories in there Step…
Read more


2014/06/28 0

Connect Peter-file-system to linux or mac

After spent 3 days to play the FUSE and macFUSE, i finally connected Peter-file-system (https://code.google.com/p/pfsbuilder) to my mac/linux machine. It is quite simple and straightforward, I write a FUSE program that create a JVM and load my PFS stub (writhed in Java), every FUSE function calls will route to the stub and manipulates the PFS…
Read more


2014/06/23 0

newlib’s reentrant system calls will map to non-reentrant by default

newlib’s reentrant system calls will map to non-reentrant by default. The reentrant version of open() can be found in newlib-2.1.0/newlib/libc/reent/openr.c As you can see, it will call _open which is defined in newlib-2.1.0/newlib/libgloss/libnosys/open.c . So if you don’t write your reentrant functions, it will jump to non-reentrant by default. For OS developer want to implement…
Read more


2014/05/04 0

linker script offset seems crazy

linker script offset seems crazy, take a look the following two pictures  


2013/02/09 0

Lowest 7 levels of /lib, /bin, /usr/bin, /usr/lib

No recursive /bin /lib /usr/bin /usr/lib


2012/12/24 0

Dev target 2013/02

1) port peter-bochs to qemu 2) finish new lib stub open() 3) make the libc layer fully working 4) Pass all PKU exams


2012/11/28 0