You should be able to compile Pencil-Kernel successfully on the following platforms:
- Windows 7 or later
To compile Pencil-Kernel you will need:
- Mingw64
- x86_64-elf-tools
- make
To run Pencil-Kernel you will need:
- qemu-system-x86_64
- Ovmf
- Get the source code,put it in a folder like
C:\pencil-kernel\
. and createsp
folder to get result of the compilation process. - Enter in the
esp
folder,creatEFI\Boot\
andKernel
folder.
cd .\esp
mkdir EFI
mkdir Kernel
cd .\EFI
mkdir Boot
- Compile
build\kallsyms.cpp
, just compile it the same way you would compile an application. - Open
pencil-kernel\build\config.txt
and configure the following:
DISK
:Theesp
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 simulatorUEFI_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
- Enter in the
pencil-kernel\build\
directory and executemake bootoader
andmake kernel
.
example:
cd C:\pencil-kernel\build
make bootloader
make kernel
if everything is successful,you can find the result in esp
directory.
- Enter in the folder
esp\Kernel
- Create
resource
folder. - Put a bitmap font typeface(optional) and a truetypeface(.ttf) file in
resource
directory.Editsrc\bootloader\boot.h
then go to thepenc-kernel\build\
directory and executemake 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}
};
- Copy the files in
esp
to a physical disk which you want install.
- follow the step
1-3
in process Install - Enter in the
pencil-kernel\build\
directory and executemake run