Complete Linux Kernel Analysis-Comments on simple multi-task kernel Makefile in Chapter 4 of 0.12 Kernel

Source: Internet
Author: User
The simple multi-task kernel in Chapter 4 of "complete Linux Kernel Analysis-Based on 0.12 kernel" by Zhao Yi, that is, the simplest kernel example that continuously outputs AAAAABBBBB, the source code is clearly explained, but how to compile an organizational file depends on makefile. I would like to comment it out as follows. If there are any mistakes, I hope you will give me some advice.
# Makefile for the simple example kernel.

# Boot. s is compiled using as86 and ld86 links

# Head. s uses gcc, which is different from Linux0.12.
AS86 = as86-0-

LD86 = ld86-0

AS = gas

LD = gld

LDFLAGS =-s-x-M


All: Image


Image: boot system
# Dd is a standard Unix Command. bs indicates the number of bytes read/write at a time. if = input file, of = outputfile,

# Skip skips the bs of the input file to start reading, and seek skips the bs of the output file to start writing.



# Skip the 32 bytes of the boot. s header, that is, skip the 32 bytes of the Minix binary header information. The input is in the first sector, that is, the boot sector is 512 bytes.
Dd BS = 32 If = Boot of = image skip = 1

# Skip the 1024 (2*512) bytes GCC header and copy the remaining part to the second sector, that is, starting from 512 bytes

Dd BS = 512 if = System of = image skip = 2 seek = 1

Sync


Disk: Image
# In Linux,/dev/fd0 is the first soft drive. This command writes the New Startup File image to/dev/fd0.

Dd BS = 8192 if = image of =/dev/fd0

Sync; sync


Head. O: head. s

#> System. map serves the-M option, indicating that GLD needs to redirect the connection image to the system. Map File.

System: head. o

$ (LD) $ (ldflags) head. O-o system> system. Map


Boot: boot. s

$ (As86)-O boot. O boot. s

$ (LD86)-s-o boot. o


Clean:

Rm-f Image System. map core boot *. o system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.