???? ????(2?) - Embedded Linux? ???? - PowerPoint PPT Presentation

About This Presentation
Title:

???? ????(2?) - Embedded Linux? ????

Description:

(2 ) - Embedded Linux SCM-EM ssyoo_at_skhu.ac.kr – PowerPoint PPT presentation

Number of Views:79
Avg rating:3.0/5.0
Slides: 99
Provided by: YooSan3
Category:

less

Transcript and Presenter's Notes

Title: ???? ????(2?) - Embedded Linux? ????


1
???? ????(2?)- Embedded Linux? ????
  • SCM-EM ?? ???
  • ? ? ?
  • ssyoo_at_skhu.ac.kr

2
????
  • ??????
  • ?? ??? (Resource Manager)
  • ???? ??? ?? ??? ?? (Computing Environment)
  • ??? ??
  • ???? ?? ???, ???, ???, ???, ???, ...
  • ???? ?? ???, ????/???, ??, ????, ?? ????, ??,
    ??, ...

3
???? ??
  • RTOS(Real-Time OS)
  • VxWorks, pSOS, LEX, uITRON, EPOCH, Nucleus
  • UNIX
  • SVR4, Solaris
  • BSD, HP-UX
  • Linux
  • Windows System
  • Windows XP
  • Windows CE.NET

4
??? ???
  • ??? ???? ??
  • ??? ?? ?? ???? ??? ???? ???
  • ??? ??? ?? ???? ?? ??? ??? ??? ???? ? ??? ??
  • ???? ???? ??? ??? ?? ?? ??
  • ???? ???? ??? ???? ???
  • Hard real-time system/Soft real-time system
  • Hard real-time system
  • ??? ?? ?? ??? ??? ????? ????? ?? ??? ?? ?? ????
    ??? ???? ??? ???? ??
  • ???? ???? ???, ????? ?? ???, ????? ?? ???
  • Soft real-time system
  • ??? ??? ?? ?? ??? ?????? ??? ???? ??? ?? ?? ???

5
???? ????
  • ??? ?????? S/W
  • ???? ??? ???? ??? ??
  • ???? ?????? ?????
  • 8bit, 16bit ???????? ? ???????? ??
  • ???? ?????? ????
  • ???? ??? ??? ?? Multi Tasking ?? ??
  • Network?? multimedia? ???? ???? ?? ??
  • Networking, GUI, Audio, Video
  • ???? ???? ??? ?????? ??? ???? ?
  • ???? ???? ??? ???? ????
  • ???? ???? ??? ????? ????? ???
  • ???? ????
  • ??? ?? RTOS(Real-Time OS)
  • ??? CE
  • ???? Linux
  • ???? JAVA

6
???? ???? (contd)
  • ?? RTOS Hard RealTime/Multi-thread/ Preemptive
  • pSOS, VxWorks, VRTX ? ??
  • ?? ????? ?? ?? ??? ??
  • ?? ???, ??? ?? ?? ???? ?? ??? ?
  • ????? ??? ??? ??? ????
  • ???? OS Soft RealTime/Multi-process/ non
    preemptive
  • Windows CE
  • ???? ???
  • ???? ??
  • ?? ??
  • ???? OS ????
  • ?? WinCE, ???? ???? ??? RTOS ?? ?? ???? ???? ??
  • OS ??
  • ???? ?? ?? ? ???? ??? OS ??? ?? ??

7
???? ???? (contd)
  • ??? CE
  • MS??? ???? ???? ??? ???? ????
  • ??? ??? ? PC? ??? ??? ?? ??
  • ??? ? ??? ? ?? ?????? ??? ??
  • ???? ?? ??? ?? ??. (??, GUI ?? ?? ??)
  • ?? ???? ???? H/W ??? ??, ??? ??
  • MS??? ???? ?????? ???

8
???? ???? (contd)
  • ???? ??
  • SUN??? ???? JAVA? ??? ????
  • ???? ??? ?? ????? ???? ??? ? ??? ??? ??
  • ????, ???? ?? ???? ??
  • ??? ? ?? ??? K?? ??? KVM(Kilobyte Virtual
    Machine) ??? ??

9
???? ???? (contd)
  • ???
  • ?? ???
  • ?? ??? ? ??? ??? ????? ??? ??? ???? ?? ?? ?? ????
    ???
  • ???? ???
  • ???? ???? ????? ??? ??? ???? ???? ???? ??? ? ???

10
???? ???? (contd)
Embedded Software I ?? Embedded linux? ????
???? ????? ??
Linux
RTOS
WinCE
Embedded Software II ?? WINCE/RTOS??? ???? ???
?? ??
11
???? (???) OS? ?? ??
  • ???
  • ???? ???? (an instance of a running program)
  • ????? ?? ?? (an execution environment of a
    program)
  • ???? ?? (scheduling entity)
  • ?? ??? ?? ??? ?? (a control flow and address
    space)
  • ?? ???
  • ?? ?? ???? ??? ????? ?
  • ?? OS ??? ???
  • ? ????? ??? ??? ?????
  • ???? ?????? ???
  • ??? ? ?? ????? ????? ?? ?
  • ??? ?? ??? ??
  • ??? ??? ????? ???? ??.
  • ?? ????? ??? ?? ?? ???? ?? ?? ??
  • ???? ?? ?? ??? ???? ??.

12
???? (???) OS? ?? ??
  • ????(Scheduler)
  • OS? ????
  • ?? ?? ?? ???? ???? ?? ?? ???? ?? ??
  • ??? ?? ?? ???? ??? ????
  • FIFO(First In First Out), Round-robin ?
  • ??(Preemptive)
  • ?? ???? ???? ?? ? ??? ??? ? ???? ??? ?? ??? ??
    ???? ??? ????? ??
  • ??? ?? / ???? ??
  • ?? ???? ??? ??? ? ????(context switching) ??
  • Context switching
  • ?? ?? ?? ?? ??? ?? ???? ??? ??(??)? TCB(Task
    Control Block)??? ??? ????? ????, ??? ??? ????
    ??? ??? ??? ??? ??? ?? ???? ?
  • Context switching? overhead?? ??? ?? ?? ??? ?
  • thread? ??? ?? ?? ???? ??

13
???? (???) OS? ?? ??
  • Mutual exclusion
  • ??? ???? ??? ??? ????? ????? ? ? ? ????? ?? ???
    ?? ??? ??? ???? ?
  • Critical section ????? access?? ??? ????
  • ?? ???? ??? ?????? ? ?? ??? ?? ?? ?? ??
  • ???? ??
  • ???? ??? ??
  • Critical section? ???? ?? ????? disable??? (CLI)
    ?? ???? ????? ?? enable ??? ?? (STI)
  • ?? CPU? ?? ???? ?? ??
  • semaphore ??
  • semaphore? ?? ??? ????? ?? ? ??? ?? semaphore?
    ??? ????? ?? ?? ? ? ??.
  • ?? ???? ??? ????? ? ?? semaphore? ??? ??.
  • Semaphore? 0 ?? waiting??.

14
???? (???) OS? ?? ??
  • Semaphore
  • ???? ??
  • mutual exclusion? ??? ????? ??
  • ??? ??? ???? ?? ??
  • ?? ??
  • ????? ???? semaphore? ???.
  • ????? ???? ??? ?? semaphore ???.
  • ?? ?? 0? ?? ?? ? ?? ?? 1 ?? ???.
  • 0?? ??? ? ??? ????. (SLEEP??)
  • ????? ? ?? ? ?? 1 ?? ???.
  • ??
  • Binary semaphore ????? ??? 0,1? ??
  • Counting semaphore 1??? ?

15
???? (???) OS? ?? ??
  • Task communication
  • ????? ???? ??
  • Global variable? ?? ?? / message passing ??
  • Global variable
  • exclusive access? ?? ??, ISR? ??? ????? disable??
    ??.
  • Task ????? ????? disable?? ?? ?? semaphore? ??? ?
    ??.
  • message passing
  • Mailbox, queue, pipe message? ??? ?? ???
  • Task synchronization
  • ??? ?? ??? ??
  • Semaphore/event flag/signal ?? ??

16
???? (???) OS? ?? ??
  • Interrupt service
  • Asynchronous event? CPU? ??? ??
  • Interrupt? ???? ???? ??? ???? ??? ??? ??? ?? ???
    interrupt latency? ?? ?? ??.
  • ISR??? ?? ?? ??? ? ??? ISR ??? ???? interrupt
    nesting? ?? ?? ??.
  • ISR??? ?? ?? ???? ??? ??? service routine?
    ???(HISR) ???? ??.
  • HISR??? ?? ????? ???? ??? ??.

17
???? (???) OS? ?? ??
  • Reentrancy code
  • ????, ??? ??? ??
  • ??? ??? ?? ???? ??? ?? ??
  • Reentrant??
  • ??? 1?? ?? 1? ????? ??? ??? 2? ???? ???? ? ??? ??
    ???? ?? 1? ??? ???? ?
  • ????? ???? ? ?
  • ?? ??? shared resource?? ??? mutual exclusive ???
    ??? ?? ??? ??? ???.
  • Reentrant?? ?? code? ???? ???, ???? ?? ????
    semaphore? ???? ?? ?? ??? ?? ??? ????
    round-robin? ?? ??? ??.

18
??? ??(history)
  • Linux ??
  • ??? ???? Linus B. Torvalds
  • 1991 version 0.01 ??
  • 1994??? ??? ?? ?? 1.0
  • 1996? 2.0
  • 1999? 2.2 ??? ???, ?????? ??? ??? ? ?? ?? ??
  • ?? 2.4 ??? ?? ???? 2.6 ?? ??
  • A. Tanenbaum ??? Minix ?? (http//www.cs.vu.nl/as
    t/minix.html)
  • Philosophy of COPYLEFT(open source)
  • GNU support
  • Various Distributions Redhat, Debian,
    Slackware, Alzza, MontaVista, Lineo, Gmate,
    Zaurus, Samsung, IBM, ..

19
Linux/GNU? ????? ???
  • ??? ???(Linus Torvalds)
  • ??? ??? ??? ??
  • ??? ????? GNU? GPL? ?? ???? ??
  • ??? ???(Richard Stollman)
  • GNU ????? ??? FSF? ??
  • ?????(CopyLeft) ??
  • ?? ?(Larry Wall)
  • ?? ???
  • ?? ?? ????? ?? ?? ?? ??
  • ? ? (Bob Young)
  • RedHat? ?? ???, ???? ??? ???

20
???? GNU
  • GNU (GNUs not Unix)
  • 80?? ?? ??? ???(Richard Stallman)? ??? ??
  • GPL (General Public License)
  • GPL? ??? ?? ?????? ??
  • ?? ??? ???? ??? ?? ?? ???? ??? ???? ?
  • ?????? ??? ?????? ???? ?? ???? ??? ?? ??? ??? ??
  • Linux? gcc, emacs ?? ??
  • BSD? ?? ??? ????? ???? ?? ??? ?
  • ???? GPL? ???? ??

21
??? ?? ??? ??
  • ?? ??
  • ?? http//www.linux.org/dist/kernel.html
  • ?? ?? X.Y.ZZ
  • X ??? ??
  • Y ??? ??, ??-gt?? ?, ??-gt??? ??
  • ZZ Modifications, ??? ??? ??
  • ?? ??
  • ??? ??? ??? ?? ???? ??
  • ??? ?? ??? ??? ??
  • ?? ??? ??
  • ???? ???? ??? ??
  • ??? ??? ??
  • ???? ??

22
Embedded Linux
  • ???? ??? ?? ??
  • H/W? ??
  • 32/64bit ??? CPU
  • S/W? ?? ?? ??
  • OS? ??? ??, ??? ????? ??(?? ???? ??)
  • ???? ??? ???? ??? ??
  • ??? ??? ?????? ???? ?? ??
  • ???? ???? ???? ??
  • Free Software

23
Embedded Linux (contd)
  • ???? ??? ??
  • ???? ???? ?? (??? ??? ?? ??)
  • PowerPC, ARM, MIPS ? ??? CPU Platform???
  • ???? ???? ?? ???? ??
  • ??? ?? ?? ?? ??? ??? ???? ??
  • ??? ??? ? ?? ??? ???? ??? ???
  • ???? ??? ??
  • ??? RTOS?? ?? ???? ???
  • ?? OS? ???? Real-Time? ???? ??
  • ?? ??? Text ??? ????? ??? ???? ??
  • GUI ??? ???? ???
  • ????? ?? ??? ??? ???
  • ?? ???? ????? ????? ???? ?? ???? ???

24
??? ???? ??
(Source Linux Kernel Internals)
25
??? ??
??
ROM? ??? ?? ??? ?? ? ???? ??? Boot Manager
??
System Bios
????? 0? ??(MBR)? ??, ???? ?? Linux kernel
??? ?? ???? ?? ?? ??(Boot Loader)
Boot manager
vmlinuz?? ?? ??? ??? ?? pid 0? swapper? ???
?? ? ??? (dmesg ?? ?? /var/log/dmesg ??)
pid 1? init? ?? ??
Linux kernel
Initd
????? ?? ?? ????? ??? ???? ?? ??? ??? ? ?
??
klogd
xinetd
xfs
(pstree ???)
26
???? ?? ??
  • 1) BIOS? ??? ???? ??? -gt ?????? ??
  • 2) ??? ???? ?? -gt ??? ??? ?? ??
  • 3) ??? ????? MBR?? ?? -gt?? ???
  • 4) MBR? ??? ???? ?? ??? ???? ?? -gt ?? ???
  • 5) ?? ?? -gt ??? ???? ??
  • 6) ?? ?? ??/ ???
  • 7) ??? ???? ??, ?? ???? ??
  • 8) ?? ??? ?? -gt ????, jffs???? ??
  • 9) ?? ??? ???
  • 10) /etc/inittab?? init??? ?? ?? ?? ??
  • 11) /sbin/init ??(PID? 1??)
  • 12) /etc/rc.d/rc.sysinit??(hostname,??? ??, ??
    ??)
  • 13) /etc/rc.d/rc?? (runlevel? ?? ???? ??)
  • 14) /etc/rc.d/rc.local(?? ??? ?? ??)
  • 15) /etc/rc.d/rc.serial (??? ?? ???)
  • 16) login

27
Bootloader LILO (1)
  • bootloader ??? ??? ??? ???? ????.
  • /etc/lilo.conf

28
Bootloader LILO (2)
  • ??? ??? ?? ???? ????.
  • (labellinux? ??? ???? ???? ?)

LILO TAB linux linux_2_4 dos LILO
linux Enter Booting Linux......
29
??? ??? ????? ????
  • ??? ????? ???? ??? ????? ??? ?? ????? ??? ???
    ?????? ????.
  • (??? ?????? /boot/vmlinuz-2.4.19? ??? ????.)
  • /etc/lilo.conf? ??? ????.
  • shell?? lilo?? ??? ???? ?????? ??? ??? MBR(Master
    Boor Record)? ????.
  • ????? LILO ????? ??? linux_2_4_19? ????.

image/boot/vmlinuz-2.4.19 labellinux_2_4_19 re
ad-only root/dev/hda1
30
??? ?? ???? ??
  • /etc - ??? ?? ?? ???? (ex /etc/lilo.conf,
    /etc/fstab ..)
  • /bin - ???? ?? ?? (ex gzip, su, tar, rpm, vi,
    mount..)
  • /dev - ???? (ex /dev/hda, /dev/cdrom..)
  • /lib - ??? ?? ????? ????
  • /home - ??? ? ???? (ex /home/ssyoo,
    /home/pirami..)
  • /root - ?????? ? ????
  • /proc - ??? ?? ???? (ex /proc/cpuinfo,
    proc/meminfo..)
  • /sbin - ??? ?? ?? ????
  • /tmp - ???? ?? ????
  • /var - ??? ?? ? ?? ?? ?? ????
  • /usr - ??????? ???? ????
  • ????? ?? /usr/src ? ??

31
Linux ?? ?? ?? ??
???? ????? I ? ? ?? ??? ????? ??
32
? ???? ?? (1)
  • arch/
  • CPU ???? ??, ? ??? ?? ?? ????? ??? (arch/arm,
    arch/i386, arch/alpha )
  • arch/arm/boot/
  • ?????? ??
  • arch/arm/kernel/
  • ???? ????(hardware dependent) ?? ?? ??
  • ??, ???? ?? ??
  • ?? ?? ??
  • ?? ??, ??? ??
  • arch/arm/mm/
  • ???? ???? ??? ?? ??
  • init/
  • ???? ???? ?? ??? ?? (start_kernel)
  • ??? 0 (init_task or task0) ??
  • ??? 1, 2, 3 ? ?? ???? ??

33
? ???? ?? (2)
  • kernel/
  • ??? ??? ?? ???? ???? (central section of the
    kernel)
  • ???? ???? ?? ?? ?? (???? ???? ?? ?? ???
    arch/arm/kernel ????? ??)
  • fork, exit ? ??? ?? ??? ?? ?? ??
  • ???? (scheduler) ??
  • ??? ?? (signal handling)/?? ?? (time management)
    ??
  • mm/
  • ???? ???? ??? ?? ?? (???? ???? ??? ?? ???
    arch/arm/mm ????? ??)
  • ?? ??? ??, ??? (paging), ???(swapping)
  • fs/
  • ?? ?? ??? (virtual file system ) ?? ??
  • open, read ? ??? ?? ??? ?? ?? ??
  • ?? ?? ??? ?? ??? ?? ????? ?? (ext2, ext3, ramfs,
    minix, jffs2, proc, nfs, msdos, coda, .. )

34
? ???? ?? (3)
  • drivers/
  • ??? ??? ???? ?? ?? ???? ??
  • ???? ????? ?? ??/??/???? ????? ??
  • drivers/block/ ?? ?? ????. ?? ?? IDE ??? (hd)
  • drivers/char/ ?? ?? ????. serial ports, tty,
    modem, ..)
  • drivers/net ??? ?? ????. ?? ?? 3C509, ...
  • drivers/pci/ PCI bus ??
  • drivers/sound/ sound card ????
  • drivers/cdrom/ CD-ROM ????
  • drivers/scsi/ SCSI ????? ??
  • ipc/
  • ????? ??? ???? ?? ??
  • ????(semaphores), ?? ???(shared memory), ???
    ?(message queues)

35
? ???? ?? (4)
  • net/
  • TCP/IP, ARP ? ??? ?? ???? (??? ?? ?????
    drivers/net? ??)
  • ?? ?????
  • include/
  • ?? ??
  • ???? ???? ?? include/linux/
  • ???? ???? ?? include/asm-/ (?? ?? ARM CPU
    ???? ??? include/asm-arm/ ????? ??)
  • modules/
  • ?? ?? ??
  • ??? insmod(modprobe), rmmod ?? ???? ?? ??/?? ??
  • lib/
  • ?? ????? ??
  • doc/ or Documentation/
  • ?? ?? ????.

36
??? ?? ??? ?? ??
.
task n
task 1
task 2
User mode
System mode
System call interface
Virtual File System
.
ext2
nfs
coda
dosfs
ntfs
procfs
buffer cache
File System
device driver
37
??? ?? ???
  • ??
  • ??? ?? ??? ???? ???? ??? ??? ?? ?, ??? ???? ???
    ??
  • ??
  • ext ??? Extended File System
  • ?? minix? ??? ????? ??
  • 255?? ?? ??? 2GB? ??? ??
  • ext2 Second Extended File System
  • ?? 64GB? ??? ??
  • FAT (File Allocation Table) ???? ?? ??
  • ???? ??, 2GB? ??? ? 8?? ?? ?? ??
  • FAT32
  • ????? ??
  • ?? 2TB? ???? ??

38
?? ???? ?? ?? ?? ??
  • ?? ????? ???? ?? ?? 10? ?
  • ???? ???? ?? ?? ???
  • EXT2 ??? ??, ???? ?????? ????? ??
  • cramfs(Compressed ROM File System)
  • ? ??? ???? ???? ???? ?? ??? ?? ?? ???
  • ?? ??? ???
  • XIP(Execute-in-Place)
  • ??? ????? ?? ????? ?? ???? ?? ???? ?? ??
  • ?? ?? ??? ???? ?? ?
  • ?? ??????? ??? ?? ??
  • ?? ?? ?? ELF(Executable and Linking Format)
    ???? ???? ?? ????
  • ELF USL?? ??? ???? ??

39
??? ??? ?? ??
  • SHELL ??
  • ??? ??? ??
  • ??? ?? ???
  • ??? ?? ???
  • ?? ??? ??? ??? ??? ???
  • ???, ???? ??

40
Shell
  • Shell
  • Command interpreter?? user? kernel? ??
  • ???? ???? ???? shell? ??? ??? ???? ??? ??? ????
    ??(System Call)?? ???? ???? ??
  • bourne shell(sh), C shell(csh), Bash, Ksh ?
  • ???? ?? shell Bash(Bourne Again Shell)
  • ?? ??? ? ?? "????(Script)" ??? ???? ???? ????
    ????? ??? shell script ??? ???? ? ??
  • Shell ????? "ed", "vi" ???? ???? ?? ??

41
Shell
  • Shell ??
  • ??? ??? ?? ??( /etc/passwd ?? ?? shell ??)
  • ?? ??? ???? ??? login shell? ??
  • echo SHELL
  • Shell ??
  • ?? ??
  • login?? /etc/passwd ??? ?? ??? ??? shell? ??
  • ?? ??
  • ?? shell? ???? ???? ?? ?? shell ????? ????? ??,
    ?? ?? exit"?? ??
  • Bourne Again shell bash
  • C shell - csh

42
Shell ??
  • Bash ?? ??
  • Bash? ??? ??? - .bashrc, .bash_logout,
    .bash_profile
  • .bashrc
  • ?? ???? ???? alias ??
  • .bash_profile
  • program?? library? ?? path ??

.bash_profile Get the aliases and functions
if -f /.bashrc then      /.bashrc fi
User specific environment and startup programs
PATHPATHHOME/bin/usr/local/arm-linux/bin BA
SH_ENVHOME/.bashrc USERNAME""         export
USERNAME BASH_ENV PATH
.bashrc User specific aliases and functions
alias ifcifconfig Source global
definitions if -f /etc/bashrc then
        . /etc/bashrc fi export
  • arm-linux ?? ??? path ??
  • (/usr/local/arm-linux/bin)
  • ifconfig ? ?? alias ??

43
Shell Script Programming
  • shell script
  • Shell ???? ???? ?? ?? ??? ??
  • Shell script ?? ????
  • ?? ??? ???

shell script? ? ?? ?? shell ??
!/bin/bash          rfe old_extension
new_extension ?? ?? ????? ?? .gif ???
.jpg? ???           rfe gif jpg if -ne
2 then   echo "??? basename 0
old_file_suffix new_file_suffix"   exit 1 fi
for filename in .1 ? ?? ??? ??? ???? ???
do   mv filename filename12   ?? ????
? ?? ?? ??? ???? ? ?? ??? ???. done
44
vi ???
  • ?? ?? vi ??? ?? ?? ??
  • vi ?? ? ???? ??? ?? ??
  • ??? ??
  • ???? ?? ???? ??? ??? ? ?? ??
  • ?????? - ?????? a,A,i,o,O? ?? ?? ?
  • ???? ?? ESC?? ???? ? ?? ?????
  • ?????? - ???? ?? ?????? ESC?? ??? ?
  • ???? ?? ???? ????? ? ??
  • ?????? - ?????? ??()? ???? ?

45
vi - ?? ??
  • ?? ?? ??
  • ?? ??

a ?? ??? ?? ??? ????(append) A ??? ?? ?? ???
???? i ?? ???? ???? (???? Insert? ?? ???
???.) I ??? ?? ?? ? ????? ???? o ?? ?? ???
?? ??? ????(open line) O ?? ?? ?? ?? ??? ????
s ??? ?? ??? ??? ???? S ??? ?? ?? ??? ????
h ??, j ??, k ???, l ??? (??? ?? ??) -
???? w ?????, b ????? - word ?? ? ??? ?
??, ?????? ? - ? ?? F ??? ???, B? ?? ??,
D ? ?? ???, U ??? ??
46
vi - ?? ??(contd)
  • ?? ??
  • ?? ? ????

x ?? ??? ?? ?? X ?? ?? ?? ?? ?? dw ? ???
?? D d ?? ???? ?? ??? ?? dd ??? ?? ?? ??
yw ?? ???? ??? ??? ???? y0 ?? ???? ?? ????
???? y ?? ???? ?? ??? ???? yy ??? ?? ??
???? yj ??? ?? ?? ? ?? ?? ???? yk ??? ?? ?? ?
??? ???? p ??? ?? ??? ?? ?? P ??? ?? ??? ?? ??
47
vi - ?? ??(contd)
  • ??

u ?? ???? (undo) U ? ?? ??? ?? ?? ???? .
?? ?? ?? ??? ???? ???? ?? /??? ?? ???? ??
(??) ???? ?? ???? ?? n ?? ??
48
vi - ?? ??
  • ???? ??
  • ?? ?? ??

s/old/new/g - old? new ? ?? s/old/new/g - ??
? ??? old ? ?? new ? ?? s/old/new/g - ?? ? ???
old ? ?? new ? ?? s/aaa//g - aaa? ??
w ??? ????? ?? q ???? ?? ?? q!
?? ??? ??? ?? e ??? ???? ??? ???? ?? r
??? ???? ??? ??? ?? !??? ????? ??
49
??? ?? ???
  • ??? ??? ????
  • ls, more, cat, grep, who, pwd
  • ps(process status), su(super user),
  • chown(change ownership), chmod(change mode)
  • useradd, userdel, passwd
  • ??? ?? ????
  • mount - ???? ?? ???? ??? ?? ?? ???? ??
  • unmount - ???? ?? ??? ??
  • e2fsck - ??? ?? ??
  • mke2fs - ??? ??? ?? ???
  • mknod - FIFO ???? ???? ?? ?? ???? ?? ??
  • ??? ?? ????
  • ping - ???? ??? ??? ??? ?? ?(??? ?? ?? ??)
  • ifconfig - ??? ????? ????
  • netstat - ?? ???? ????? ?? ????

50
?(Home) ????
  • ??????? ???? ??? ? ???? ?? ??? ??? ?? ?(Home)
    ???? ?? ?
  • ????? home/ID", "/usr/ID" ???? ??
  • ???? ??? ?????? ??? ??? ????, ???, ????? ??? ????
    ??? ? ??
  • ???? ??? ? ??? ??? ???? ???? ? ???? ???? HOME???
    ??? ??
  • ?? ??? ? ????? ???? ???? ???? "HOME"? ??
  • ???? ????? ???? ??? ???? ???? ? ????? ??
  • ( ".bash_profile" , ".bash_logout", ".bashrc" )

51
????? ????
  • ????
  • ?? ?????? ??? ???? ?????? ???? ?? ???? ???? ???
    ??
  • ?? ??
  • ??(root) ????? "/"? ???? ?? ???? ??????? ?? ???
    ???? ??
  • ????
  • ?? ????? ???? ???? ????? ???? ???? ????? ???? ??

vi /user/ssyoo/test.c
vi ./ssyoo/test.c
52
???? ?? ???
  • ???? ???
  • mkdir OPTION DIRECTORY...
  • ??? ???? ???, ??, ??? ??? ???? ????? ??? ?? ???
    ???? ??
  • ???? ??
  • rmdir OPTION... DIRECTORY...
  • ?? ???? ?? ??
  • cd directory
  • cd .. (? ?? ? ????? ??)
  • ????/?? ?? ??? ???
  • mv OPTION... SOURCE DEST

53
?? ?? ??
  • ?? ???? ???? ??? ???? ???? ?? ??? ??? ???? ????
    ???? ??
  • ?? ??? ??? ??? ??? ???? ??? ???? ?? ??? ?? ????
    RAM? ??

? ? ? ?
???? (Regular file) ????? ??? ???? ????? ???
???? ?? (Directory file) ??? ???? ???? ???? ???? ??? ??? ??? ???? ??
???? (Special file) ???, CD-ROM, ???? ?? ????, ????? ????
54
?? ?? ???
  • ?? ??
  • rm OPTION... FILE...
  • -r ??? ?? ??? ???? ?? ??????? ???? ?? ??? ?????
    ??
  • ?? ??
  • cp OPTION... SOURCE DEST
  • cp OPTION... SOURCE... DIRECTORY
  • -r ??? ?? ?? ????? ?? ???? ??
  • ?? ?? ??
  • cat OPTION FILE...
  • more OPTION FILE...
  • head OPTION... FILE...
  • tail OPTION... FILE...

55
?? ??
  • diff ???? ?? ???? ??? ?? ???
  • diff -i -Dflag fileName1 fileName2
  • -i ????? ??? ????(ignore)
  • -Dflag C preprocessor? ?? ??? ??

56
?? ??
  • find pathList expression
  • pathList ??? ??? ??? ??? (recursive
    search)
  • expression

find . -name ".txt" -print
-name pattern ?? ??? pattern? ???? ?(,
, , ? ?? ??) -perm oct
permission? 8?? ??? oct? ???? ? -type ch
??? ??? ch?? ? (ch bblock,
cchar) -user userId ??? ???? userId??
? -group groupId ??? ??? groupId?? ? -atime
count ??(access)? ? ?? count ????
? -mtime count ??(modify)? ? ?? count
???? ? -ctime count ???? ??? ??? ??
??? count???? ? -exec command ?? ?? command?
???? 0?? ?. \? ??
command? argument? ??, ?? ??? ????
?? -print ?? ???? ????? ? ??
?? -ls ?? ??? ??? ???? ?
?? ?? -cpio device ??? ??? cpio ??(5120
byte records)?? device? ?? ? ? ?? !expression
expression? ?? ?? \( expr1 -a expr2 \)
? expression? and \( expr1 -o expr2 \) ?
expression? or
57
?? ?? ??
  • ?? ??(???) ?? - grep
  • ??? ???? ???? ????? ??
  • grep??
  • ??? ????
  • , , .? ?? ?? ?? ??
  • ????? ??

"-v"(invert)? ??? ???? ???? ??? ??? ?? ??? ??
"-n"(number)? ????? ??? ???? ???? ??? ??
"-c"(count) ??? ?? ???? ???? ??? ??? ???? ??? ?
"-l"(listfile) ??? ??? ??? ?? ?? ?? ?? ??? ??? ?
58
?? ???? ??(chmod)
  • ?? ?? ?? - chmod
  • ???? ????? ????? ??
  • chmod OPTION... MODE,MODE... FILE...
  • 8??? ???? ???? ?? ????(Absolute mode)??? ?? ???
    ?? ????? ????? ???? ???? ????? ???? ???? ??
  • Chmod 777 test.c
  • Chmod a test.c
  • ????? ???? ? ?? ???? ?? ?? ??
  • ??? 3??? ???? ? ??? ???, ??, ?? ???? ??
  • ?? ? ??, ?? ?? ??? ??? ?? 7(421)? ??

??? ?? 4 ?? ?? (100) 2 ?? ?? (010) 1 ?? ?? (001) 0 ????? ???? ?? (000)
59
?? ???? ??(Contd)
  • ????? ???? ??

?? ??
u(user) ??? g(group) ??? ?? ?? o(other) ??? ???? ?? ?? ???? ?? a(all) ?? ??? ? ???, ??,??? ?? ??? ???? - ???? ??? ??? ???? ???? ???? ?? r ?? ?? w ?? ?? x ????
60
?? ?? ???
  • ?? ??? ?? - chown
  • ??? ???? ??? ???? ? ???? ??? ???? ???? ??
  • "chown" ???? ???? ? ???? ??? ? ??
  • chown OPTION... OWNERGROUP FILE...
  • ?? ??? ?? - chgrp
  • ?? ??? ??? ??? ??? ?? ?????, ?? ??? ???? ???? ???
    ?? ?? ??? ? ??? ? ? ??
  • chgrp OPTION... GROUP FILE...

61
?? ??? ??
  • gzip - ???? ?? ???? (??? gunzip)
  • gzip (option) (file or directory)
  • bzip2 - bzcat ???? ?? ??? ?? ??? ?

?? -d ??? ?? -l ?? ??? ??? ??? ???? -r ?? ??????
?? ?????? ??? ????. -t ?? ??? ???? ????. -v ??
?? ??? ????. -9 ??? ????.
?? -d ??? ????. -z ??? ????. -t ?? ??? ????
????. -v ?? ?? ??? ????
62
?? ??? ?? (Contd)
  • compress
  • ??? ???? ?? ??? ????? ???? .Z"?? ????.
  • ??? ??? ??? ?? ???? zcat ???? ??
  • ??? ????uncompress? ??
  • ????? ?? ??? ?? tar ???? ?? ?? ??

63
?? ?? (tar)
  • ?? ?? ??? ??? ????? ???? ????? ??? ??? ??
    ????(archive) ????
  • ?? ?? ??? ?? ?? ???? ?? ???? ?? ? ???? ?? ???
  • ??? ??
  • tar options archive-file target-files

?? ? ?? -c ??? ???? ??? ????. -t ????? ???
????. -x ?? ??? ????. -r ?? ??? ??? ??? ????.
--delete ?? ???? ?? ??? ????. -u ?? ???? ???
???? update ??. -v ????? ????. -f ?? ???? ????.
-z ????? ??? gzip?? ??? ????.
64
?? ??(Contd)
  • source ???? ??? ?? tar cvf source.tar source
  • ?? ??? ???? gzip source.tar
  • ??? ???? gunzip source.tar.gz
  • ?? ??? ?? ?? ?? ?? tar tvf source.tar
  • ?? ???? ?? ?? tar xvf source.tar
  • gzip? ?? ????
  • tar cvf files gzip 9 gt tarfile.tar.gz
  • ?? ??? ?? ???? ???? ??? ??? ? ??
  • ??? ??? ?? ?? ??? ???? ?? ?? ???
  • gunzip 9c tarfile.tar.gz tar xvf
  • ?? ??? ??? ? ??? ?? ??
  • tar(gtar) cvzf tarfile.tar.gz files

65
????? ???(???)
  • ???? ???
  • ????? ?? ????? ??
  • ??? ??? ?? ? ??
  • ??? ??? ???? ?? ?? RPM ?
  • ?? ???
  • ??? ?? ??? ????
  • ??? ??? ??? ??? ?? (????, OS)
  • ??? ??? ???? ?? ? ?? ???

66
RPM
  • RPM ???
  • RedHat Package Manager
  • ?????? ???? ??? ?? ?? ??
  • www.rpm.org?? GPL??? ???? ??, ??
  • RPM ??
  • ?? ??? ?? ??? ?? ??? ??
  • ??? ? ?? ??? ???? ?? ??????? ??
  • ??? ???? ?? ???? ?? ? ??? ?? ?? ??
  • rpmfind.net? ?? ?? rpm ??? ???
  • RPM ??
  • ??? ???? ? ??
  • ????? ??
  • ??? ??
  • ??? ?? ??

67
RPM ??? ???
??? ?? - ?? - ??? - ????.rpm
  • ??? ??(Package name)
  • ??? ??? ???? ??? ??? ?? ??? ?? ???? ?
  • ??(Version)
  • ?? ???? ??? ???.
  • ???(Release)
  • ??? ?? ???? ? ??? ??? ???? ???? ??? ?? ?? ???
    ???. ??? ???? ?? ???? ??? ? ????? ?? ???? ?.
  • ???? ???? ????(Architecture)? ??. ? ?? ????? ????
    ?? ???? ?.
  • ???
  • RPM?? ???? ????? ?? ???? ?.

68
??? ??/??/?????
  • RPM ???? ??? ??? -ivh ??? ?? ??
  • RPM ???? ??? ???? -i ??? ??
  • ??? ???? ??? ?? ??? -i ??? ?? -v ??? ??
  • RPM ?? ??? ???? ?????? ?? ???? -h ??? ??
  • RPM ???? ??? ??? -e ??? ??
  • RPM ???? ??????? ???? -U??? ??
  • ????? -Uvh ??? ??
  • ? ?? ?? ? ?? -U ????? ?? ??? ?? ??? ???? ? ???
    ???? ??? ??? ? ????, ? ??? ???? ?? ??? ???? ???
    ?? ?
  • ???? ??? ???? ?? ?? ??? -qa ?? ??
  • ?? ???? bootp ?? ???? ?? ??? ?? ?? ?
  • ?) rpm -qa grep bootp

69
??? ?? ??
  • ??? ?? ?? ??
  • ?? ??? -q? ?? ???? ??? ?? ?? ??
  • rpm -qi gcc-2.95-4.3wow

-a ?? ??? ?? ???? ????. -f lt??gt lt??gt? ??? ????
???? ????. -F -f? ??? ????? ?? ???? ????? ??
???. -p lt?????gt ??? ??? ??? ?? ??? ????. -P
-p? ??? ??? ?? ?????? ??? -I ??? ??, ???? ??
??? ??, ??? ??, ??, ??? ??, ??? ??, ???? ?? ??
?? -l ???? ??? ?? ??? ?? -s ??? ???? ?? ??
??? ?? -d ????? ??(man page, readme ?)? ? ???
?? -c ?? ??? ??? ??? ??(sendmail.cf, passwd,
inittab)
70
????? ???
  • ?? Apache ??? ??
  • RPM(RedHat Package Manage)? ???? ??
  • .rpm ??? ???? ????.
  • ????? ????? ???? ???? ??
  • ?? .tar.gz?? ???? ????.

gtrpm Uvh apache_1.3.19.rpm
71
????? mount
  • ???(mount) ????? ????? ??(tree)? ?? ????? ??
    ???? ? ?? ??
  • CD-ROM? ??? ??? ???? ???
  • ??? ??
  • /etc/fstab ????? ??? ???
  • ??? ??? ?? ???? ?????? ? ??? ??

umount /mnt/cdrom
/dev/hda1 / ext2 defaults 1 1 /dev/hdb1 /b ext2
defaults 1 1 /dev/fd0 /mnt/floppy auto noauto,
owner 0 0 ...
72
????? ??
  • ??? ????? ??
  • IDE ???? ??/dev/hda /dev/hdd ?? ??? ???? ???
    (IDE ??? master/slave ??? ???)
  • ???? ??? ??
  • ??? ????? ???
  • ????? ??
  • proc ????? ??? ??? ??. /proc? ?? ?? ??

fdisk /dev/hdb
fsck t ext2 /dev/hdb
73
?? ??? ??? ??(fsck)
  • ??? ?? ???? ?? ???
  • ?? ???? ??? ??, ????? ???? ?? ?? ??? ???, ????? ?
    ???? ??? ?? ???? inode ?? ?? ??? ???? ??
  • ?? ???? ???? ??? ??? ??? ??? ?? ?? ?? ?? ????
    ???? ?? ??? ??
  • fsck(for file system consistency check) ??? ??
    ???? ???? ??? ??? ??? ?? ????? ??? ??? ???? ??
  • fsck ??? ????? ??? ??? ??? ??? ??? ?? 5? ??? ???
    ??
  • Blocks and sizes, Pathname, Connectivity,
    Reference count, Free List

74
?? ????(Link) ???(ln)
  • ?? ? ????? ??, ???? ? ??? ?? ?????, ? ??? ??
    ????? ???? ? ??????? ? ??? ?? ??? ?? ???? ?? ??
    ???? ???? ??? ??? ??? ?? ? ??
  • ???? ???? 1???? , ????? ???? ?? ?? ??? ??? ??
    ???? ???? ??

ln ln
???? ln OPTION... TARGET LINK_NAME ln OPTION... TARGET... DIRECTORY ln OPTION... --target-directoryDIRECTORY TARGET...
???? -f ??? ??? ? ? ?? ????? ??? ?? ??? ???? ? -s ?? ?? ??? ??? ?? ??
75
?? ????(Link) ???(ln)
  • ?? ??
  • ??? ?? ??? ???? ??
  • ?? ?? ??? ??? ????, ??? ??? ???
  • ?? ??? ??? ??? ?? ?? ??? ??
  • ??? ??(??? ??)
  • ?? ?? ???? ?? ??
  • ?? ?? ??? ???? ??? permission? l--- ??? ???
  • ls -F ? ??? ? ?? ?? ?? _at_? ???

ln -f -s original newLink -f ????? ?????
?? ??? ??? ? ?? ? -s ??? ???? ?? ???? ?? ??
ln -f -s original driectory ???
??(original)?? ?? ??? directory? ?? (?) ln
hold.3 hold ln hold. tmpdir ln -s
/usr/include/stdio.h stdio.h ls -l stdio.h
lrwxrwxrwx 1 mjkim 20 Jan 12 1758 stdio.h -gt
/usr/include/stdio.h
76
??? ????(df,du)
  • ?????? ?? ??? ??? ??? ??? ?? ????? "df"? ??
  • ????? ??? ? ????? ???? ??? ??? ???? ?
  • ??? "cron"??? ? ????? ????? ?? ??? ??? ? ? ??
  • ??? "95"? ???? ?? ?????? ???? ??. ???? ??????,
    ???? ?? ?? ???? ?? ?? ????? ?? ??? ?
  • ???? "du" ???? ??? ?? ??? ????? ???? ?? ???? ???
    ?? ??? ???? ???? ?????(Kbyte) ?? 512 byte ??? ???

77
??? ?? ??
  • ??? ??? ?? ???? ??? ????? ??
  • ??? ??? ??(console) ?? ?? /var/log/message? ??
    ??? ??
  • xterm???? tail f /var/log/message ? ???? ??? ???
    ???? ? ??.
  • ??? ??? ? ? ?? ??
  • syslogd ????? ?? ?? ??.
  • /etc/rc.d/init.d/syslog start ??? ?? syslogd
    ????? ?????.

78
???? ?????
  • ???? ??? ???? ??? ???(super user root) ??? ???
    ??.
  • ???? ?????
  • ????? ??????

su Password root ????
????? ???? ???. USER, PATH? ????? ???? ???.
su - Password root ????
????? root? ????? (/root)? ???? USER, PATH ?
????? ????.
exit
79
??? ??
  • ??? ??
  • ??? ???? ??(??)
  • ??? ??

passwd ssyoo
userdel ssyoo
80
??? ??
81
??? ??
  • ???(preprocessing)
  • define, include, if? ?? ??? ??? ??
  • ??? ??? ?? cpp ????? ??
  • ???(compile)
  • ?? ?? ?? ????? ?? ??? ???? ??? ??(.s)
  • ????? ???? ??? ???? ?? ?? ????? ???
  • ??? ???? ?? ??? ????? ?? ??? ???? ?? ??? ???
  • ???(assemble)
  • ???? ??? ?? ??? ???? ??? ??(.o)
  • ???? ?? gas ????? ???
  • ????? ???(CPUOS)?? ??? ?? ?? ???? ?? ??
  • ??(linking)
  • ???? ??? ??? ?? ??? ??(.o)
  • ????? ??? ? ???? ???
  • ??? ?? ld ????? ??

82
gcc ???
  • GNU C Compiler , GNU Compiler Collection ??
  • FSF (Free Software Foundation)? C, C ????
  • ????, ????, ?? ??? ?
  • ? ?? ??(hello.c) ? ??? ??
  • gcc o hello hello.c
  • -o ?? ?????? ???? ??
  • -S ?? c?? ??? ?? ??? ?? -gt ???? ?? ??
  • ?? ??? ??? ??? ????
  • gcc o hello hello.c hello_world.c
  • -o ??? ??? a.out? ?? ???
  • ???? ???
  • ????? ??? ??? ? ???? ??
  • -D ??? ??? ??? ??
  • gcc c DEM_FILEembedded helloworld.c
  • -DEM_FILE? ???? define EM_FILE embedded? ??? ??
  • -U ??? ??? ??? ??? - undef? ??? ???

83
gcc ????
  • ???? ??
  • -I (??)??? ?? ?? ?? ??
  • gcc I../include hello_world.c
  • ??? ?????? ?? ?? ??? ????? ??
  • -l (?)??? ????? ??
  • gcc o hello hello.o hello_test.o lm
  • -lm? ?? ?????? ????? ??
  • ?? ?????? ?? ?? ?????? libm.a? ??
  • -L ??? ??? ????? ??
  • gcc o hello L/usr/local/mylib hello.o
    hello_test.o lx
  • ?? ?????? ?? ? ?? ????? ??
  • ?? ?????? ??? ??? ????? ??

84
gcc ???? ??
  • ???? ??

?? v (verbose) ????? ??? ? ???? ???? ??? ???
?? Wall - ??? ??? ??? ??? ?? ??? W - ?????? ??
??? ??? ??? ???? ?? ??? ?? traditional ???? C
?? ?? ansi ANSI C ?? ?? C ?????? ??? ???
??(??? ? ??) nostartfiles ??? ? ?? ??? ?? ???
?? ?? ??? ??? ?, ???? ????? ??? nostdlib ??? ?
?? ?????? ?? ??? ?? ?? ?? ????? ?? ?? ??? ?????
?? static ??(static) ?????? ?? shared ??? ?
?? ?????? ???? ?? ?????? ?? ???? ??
?????? ??(???)
85
???? ??
  • ???? ?? ???? ?????
  • ???? ? ???? ?? ??? ?? ???? ??
  • ???? ?? ???
  • ????? ????? ????? ????
  • gcc? ???? ??? ??? ?? ????? ??
  • ??? ??

g - ??? gdb?? ? ? ?? ??? ?? ??? ?? p - prof??
????? ? ? ?? ???? ?? pg - gprof?? ????? ? ? ??
???? ??
O - ?? 01 ? ?? O0 - ??? ??(???) ??? ??/ ??? ??
?? O1 - ?? ??? ?? ??? ?? ? O2 - ? ?? ???? ???
86
???? ?? ???
  • ??? ??
  • ???? ?? ?? ?? ??
  • ?????? ?? ????
  • -Wa,option-list
  • Option-list?? ?? ?? ??? ??(,)? ???? ???
  • ??? ?? ????
  • -Wl,option-list
  • Option-list?? ?? ?? ??? ??(,)? ???? ???

ffast-math ?? ??? ??? ??? ????
??? finline-functions ??? ??? ?? inline ???
???? ??? fno-inline ?? inline?
??? funroll-loops ??? ?? ??? ???? ?? ???
87
????(Assembler)
  • ???? ?????? ???? ?? ??
  • ? ????? ??? GNU ???? ??
  • ???? ??
  • as list-of-options list-of-source-files
  • assemble ??
  • -ah C ????? ???? ???
  • -al ???? ?? ??? ???? ???
  • -as ?? ???? ?? ???? ???

88
??(linker)
  • ld ??
  • ???? ??? ??????? ???? ?? ?? ??
  • ?? ??, ?? ??, ?????? ?? ?? ??? ???? ??? ?? ????
    ??
  • ????? ld? ?? ???? ?? gcc? ???
  • ?? ?????? ??? ??? ?? ? ?? ??
  • ?? ?????? ?? ?? ?
  • ld ??
  • ld list-of-options list-of-files-and-libraries
  • ?????? llib-name ??? ??, ??? ????? ?? ??
  • ?????? ?? ?? ??? ??? ??? ??? ???
  • ld prog1.o lm prog2.o gt prog2? math ???
    ???? ??
  • ??? ???? ??????? ??? ?? ??? ??? ???
  • ld prog1.o lat lfo gt fo ??????? at ?? ?? ?
    ??
  • ranlib? ???? ??? ??? ?? ?? ?? ??

89
??(linker)
  • ld ?? ?? ???
  • ?? ?? ??? ?? ??? ?? ??? ?? ???
  • C ????? ???? ??? ??
  • OS?? ???? ?? ?? ?? ??? ??? ??? ??
  • ????? ????, ?? ??? ????? /lib/crt0.o
  • gcc? ld
  • ??? ? ??? ??

gcc test.o
ld dc dp e start X o a.out /usr/lib/crt0.o
expo.o -lc
90
??(linker)
  • ld ???

-o name ?? ?? ?? ?? -lname ?? ????? ?? (/lib
/usr/lib) -Ldir ?? ????? ???? ?? -s ?? ??? ??
??? ?? (ref. strip ??) -x ?? ??? ?? ?? ?? -n
??? ??? ?? ???? ?? -r ???? ?? ? ? ??? ???? ??
?? -e name ?? ??? ????? name ??? ?? -M ?? ???
?? ?? ??? ????? ???? ??? ?? -b format ???? ???
??? ???? ?? ?? -oformat format ??? ??? ???? ???
??
91
????? ???
  • ar ???? ???? ??? ????? ??
  • ??? c????? ??? ?? ?? ???? ??? ??? ?????? ?? ??
  • ??? ????? ??
  • ar rs libname list-of-files
  • r ?? ??? ???? ??? ??? ????? ??
  • s ?? ?? ????? ?? ??(ranlib ???)
  • ????? ??
  • ar rus libname list-of-files
  • ?????? ??? ??? ??? ???? ??
  • ??????? ?? ???
  • ar ds libname list-of-files
  • ??????? ?? ??
  • ar x libname list-of-files

92
?? ????? ?????
  • ?? ?????? ??? ????? ??
  • ?? ?????
  • ????? /usr/lib? ??? libXXX.a ? ??
  • ??? ?? ???
  • ?? ?????
  • /lib? ??? libXXX.so.version?? ?? ??
  • Version? major.minor? ???? ??
  • Ld.so? version?? major ??? ???
  • ??? ?????? ??? ??
  • ??? ?????? ?????? ??

93
Make(1)
  • Make ?? ? ??
  • ???? ??? ?? ????
  • ?? ??? ??? ??(??)? ???? ??? ???? ???? ?? ?? ??
  • ???? ?? ??? ?? ??? ??? ??? ??? ???? ????? ????
    ??? ???? ???? ??? ? ???.
  • ?? ?? ????? ???? ????, ???? ??? ?? ???? ???
  • gmake gnumake? make ?? ??? ??
  • Make ??
  • ?? ??? ???? ????? ?? ??? ????? ?? ?? ??? ????
    ???? ?? ?? ???? ?? ??.
  • ??? ?? ?? ??? ???? ?? ??(makefile)? ??
  • GNUmakefile, Makefile, makefile ? ??? ??? ??.
  • makefile? ???? ??? ?????? ??

94
Make(2)
  • Make ???
  • make -f makefile_name
  • -f ???? ??
  • ???? Makefile,
  • ???? ??? ?? ?? ???
  • makefiles
  • ??? ??? ??? ?? ?? ?? .make ?? ??

95
Make(3)
  • makefiles ?? ? ??

targetList dependencyList TAB commandList tar
getList ?? ?? ?? dependencyList ?? ?? ??
commandList ??? ??
(?)
master master.o pirami.o gcc master.o
pirami.o -o master master.o master.c
pirami.h gcc -c main.c pirami.o pirami.c
pirami.h gcc -c pirami.c
96
Make(4)
  • make ?? ??
  • (?)
  • ??? ???? ????? ?? ?? ??? ??
  • make? leaf???? root???? ????? ?? ??? ??? ?????
    ????? ?????? ????? ??? ??? ???? ??

97
Make(5)
  • make ??
  • make -f main1.make
  • ???(Macros)
  • make?? ???? ??
  • ??? ???? ?? ??? ???? ??.
  • ???
  • ?? ???
  • (??) , ?? , ???? ??.
  • (?)token replacementText
  • make ?? ?? ?? (token)? replacementText? ??
  • ??? Macro
  • ASFLAGS, CFLAGS, CPPFLAGS

98
Makefile ?? ?
OBJECTS main.o helloworld.o helloworld
(OBJECTS) TABgcc o helloworld
(OBJECTS) main.o main.c TABgcc c
main.c helloworld.o helloworld.h
helloworld.c TABgcc c helloworld.c clean TA
Brm (OBJECTS) helloworld
.SUFFIXES .c.o OBJECTS main.o helloworld.o CC
gcc CFLAGS -g -c TARGET helloworld (TARGET)
(OBJECTS) (CC) -o (TARGET)
(OBJECTS) clean rm (TARGET) (OBJECTS)
core main.o main.c helloworld.o helloworld.h
helloworld.c
Write a Comment
User Comments (0)
About PowerShow.com