OS-2

Chapter 2: Setup the development environment

The first step is to setup a good and viable development environment. Using Vagrant and Virtualbox, you’ll be able to compile and test your OS from all the OSs (Linux, Windows or Mac).

Install Vagrant

Vagrant is free and open-source software for creating and configuring virtual development environments. It can be considered a wrapper around VirtualBox.

Vagrant will help us create a clean virtual development environment on whatever system you are using.
The first step is to download and install Vagrant for your system at http://www.vagrantup.com/.

Install Virtualbox

Oracle VM VirtualBox is a virtualization software package for x86 and AMD64/Intel64-based computers.

Vagrant needs Virtualbox to work, Download and install for your system at https://www.virtualbox.org/wiki/Downloads.

Start and test your development environment

Once Vagrant and Virtualbox are installed, you need to download the ubuntu lucid32 image for Vagrant:

vagrant box add lucid32 http://files.vagrantup.com/lucid32.box

Once the lucid32 image is ready, we need to define our development environment using a Vagrantfile, create a file named Vagrantfile. This file defines what prerequisites our environment needs: nasm, make, build-essential, grub and qemu.

Start your box using:

vagrant up

You can now access your box by using ssh to connect to the virtual box using:

vagrant ssh

Put any file into the same directory of Vargrantfile, it will be available in the /vagrant directory of VM (in this case, Ubuntu Lucid32):

cd /vagrant
Build and test our operating system

The file Makefile defines some basics rules for building the kernel, the user libc and some userland programs.

Build:

make all

Test our operating system with qemu:

make run

The documentation for qemu is available at QEMU Emulator Documentation.

You can exit the emulator using: Ctrl-a.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值