Skip to content

LinChenjun2008/Pencil-Kernel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of contents

Platforms

You should be able to compile Pencil-Kernel successfully on the following platforms:

  • Windows 7 or later

Dependencies

To compile Pencil-Kernel you will need:

To run Pencil-Kernel you will need:

Compiling

  1. Get the source code,put it in a folder likeC:\pencil-kernel\. and creat esp folder to get result of the compilation process.
  2. Enter in the esp folder,creat EFI\Boot\ and Kernelfolder.
cd .\esp
mkdir EFI
mkdir Kernel
cd .\EFI
mkdir Boot
  1. Compile build\kallsyms.cpp, just compile it the same way you would compile an application.
  2. Open pencil-kernel\build\config.txt and configure the following:
  • DISK:The esp folder created above.
  • PHYSICAL_DISK: The physical disk which you want install pencil-kernel.(Optional).

example:

DISK = C:\pencil-kernel\esp
PHYSICAL_DISK = E:\
  • Mingw_CC: Mingw GCC paths.
  • CC: x86_64-elf-tools GCC paths.
  • LD: x86_64-elf-tools linker path.
  • GDB: gdb debugger(Optional).
  • NM
  • OBJCOPY
  • OBJDUMP
  • RM:(Optional).
  • KALLSYMS: kallsyms compiled in step 3.
  • QEMU:qemu simulator
  • UEFI_BIOS:Ovmf

example:

LD        = x86_64-elf-tools/x86_64-elf/bin/ld.exe
GDB       = MinGW64/bin/gdb.exe
NM        = x86_64-elf-tools/x86_64-elf/bin/nm.exe
OBJCOPY   = x86_64-elf-tools/x86_64-elf/bin/objcopy.exe
OBJDUMP   = x86_64-elf-tools/x86_64-elf/bin/objdump.exe
RM        = rm.exe
KALLSYMS = build/kallsyms.exe
QEMU      = qemu/qemu-system-x86_64.exe
UEFI_BIOS = vm/ovmf.bin
  1. Enter in the pencil-kernel\build\ directory and execute make bootoaderandmake kernel.

example:

cd C:\pencil-kernel\build
make bootloader
make kernel

if everything is successful,you can find the result in esp directory.

Install

  1. Enter in the folder esp\Kernel
  2. Create resource folder.
  3. Put a bitmap font typeface(optional) and a truetypeface(.ttf) file in resource directory.Edit src\bootloader\boot.h then go to the penc-kernel\build\ directory and execute make bootoader to recompile the bootloader.
struct Files Files[] =
{
    {L"Kernel\\kernel.sys",0x100000,AllocateAddress,0x80000001},
    // Change the file path to the bitmap font
    {L"Kernel\\typeface.sys",0x600000,AllocateAddress,0x80000002},
    // Change the file path to the truetypeface font
    {L"Kernel\\resource\\typeface.ttf",0x800000,AllocateAddress,0x80000003}
};
  1. Copy the files in esp to a physical disk which you want install.

Run in qemu

  1. follow the step1-3 in process Install
  2. Enter in the pencil-kernel\build\ directory and execute make run

About

A tiny operating system kernel

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages