RTEMS serial (3) Start the mirror file production (on)

xiaoxiao2021-03-06  47

Author ray

RTEMS copyright, reproduced please indicate: Source http://www.rtems.net, author ray@rtems.net

Summary

This section describes how to make a floppy disk image file, and install GRUB above the mirror file to test compilation RTEMS kernel.

In order to test the compiled mirror, we can test above the ordinary PC:

First, describe how to compile Sample. In general, when generating system library files, you have compiled Sample, but if you need to change SMAPLE or write a program yourself, you need to set the following environment variables. (Note: There are many commands that need root privileges)

First need to set the environment variable:

export RTEMS_MAKEFILE_PATH = / -rtems / export RTEMS_MAKEFILE_PATH = / home / ray / embedded / rtems_build / i386-rtems / c / i386ex / make

Then compile Samples that need to be tested

Compiling executables will staticly include the Basic library of RTEMs, which can be directly used as a kernel.

In order to load the kernel, you also need to install GRUB

The following describes how to make a launched image using the Loop device.

Linux platform:

First, a blank mirror file:

#dd if = / dev / zero of = boot.img BS = 1K count = 1448

This command has established a mirror file of a floppy disk, the size is 1.44m, then associates the boot.img mirror file and the loop device.

#losetup / dev / loop0 boot.img

Format the image file with EXT2 file system

MKE2FS / dev / loop0

Then build ./fd0 directory

#mount boot.img ./fd0 -o loop

The mirror file mount to / fd0 directory can then be installed on the GRUB first download GRUB version 0.95 version (you can use the I386 binary code that has been compiled, you can also compile yourself yourself). In the resulting binary, it is: STAGE1 and STAGE2 two file installation steps will be described below, and finally uninstall Loop devices after the last installation is installed.

#losetup -d / dev / loop0

BSD platform:

Note that mirror files are made using MDConfig or vnconfig in BSD, for example:

#dd if = / dev / zero of = boot.flp BS = 1k count = 1448 #mdconfig -a -t vNode -f boot.flp -u 0 #NewFS MD0C #MOUNT / DEV / MD0C / MNT

Use the above command to the / mnt directory operation is equivalent to the operation of the image file

GRUB installation

Method 1: Manually install GRUB

Manual installation requires two formatted floppy disk mirror files, boot.img and RTEMS.IMG, the first is a file system for GRUB installation disks with RTEMS. (In fact, using a mirror file can also be installed in the first mirror file to install GRUB

# DD if = stage1 of = boot.img BS = 512 count = 1 # dd if = stage2 of = boot.img BS = 512 Seek = 1

Then, the Stage1 and Stage2 here Stage1 and Stage2 are the mirror files generated (or downloaded) I386 GRUB to make Rtems.img: # dd if = / dev / zero of = RTEMS.IMG BS = 1K count = 1448 # LOSETUP / dev / loop0 rtems.img # mke2fs / dev / loop0

Copy Stage1 and Stage2 to RTEMS.IMG, then use the production of good first disk (VMware settings as shown below):

After starting the grub, enter the command line mode. After the system is started, there is the following interface display:

Then use VMware to disconnect the floppy disk: as shown below

Then, then replace the floppy disk image to RTEMS.IMG, reselect the mirror file, (Menu VM -> Setting) Reconnect the floppy disk (VM-> Removable Devices-> Floppy1 Connect) and then use the following command to install.

GRUB> Install = (fd0) / stage1 (fd0) (fd0) / stage2 0x8000 (fd0) / GRUBMENU

This is installed on the mirror file. If there is a problem, there is a problem in the loading and setting of the floppy mirror file (whether the image is correct? Is it broken? ...) and load the mirror file to the local / fd0 directory (note, it is the catalog of its own, Not / dev / fd0)

# mount rtems.img ./fd0 -o loop

After all work is finished, the final unloading device

# umount ./fd0

# losetup -d / dev / loop0

转载请注明原文地址:https://www.9cbs.com/read-63361.html

New Post(0)