1 / 21

Lab1

Lab1. Linux Basic Commands, Shell and Kernel Compiling. Chulmin Kim cmkim@core.kaist.ac.kr Computer Engineering Research Lab. EECS, KAIST. Contents. 1. Objectives. 2. Environment Configuration. 3. Basic Commands and Shell. 4. About Kernel. 5. Summary and Policies.

Télécharger la présentation

Lab1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab1 Linux Basic Commands, Shell and Kernel Compiling Chulmin Kim cmkim@core.kaist.ac.kr Computer Engineering Research Lab. EECS, KAIST

  2. Contents 1 Objectives 2 Environment Configuration 3 Basic Commands and Shell 4 About Kernel 5 Summary and Policies

  3. Objectives of Lab1-1 • Linux? • Operating System for general PC or Embedded Device • Based on UNIX • GNU support • Various Distributions : Fedora, Debian, Ubuntu, OpenSUSE, Redhat • Characteristics • Multiusers • Opensource • Low cost (almost zero, while WIN7 cost about 200,000 won)

  4. Objectives of Lab1-1 • Internal of Linux : Kernel

  5. Objectives of Lab1-1 • Get used to Linux! • Opensource-Based • Do-It-Yourself • As you wish • Lots of Tools, Simulators, Benchmarks and ETC already optimized to Linux • Sometimes, you can do your job more efficiently. • Using shell commands shown in this lab.

  6. Environment • Screenshots 3. Type ID & PW 1. SET Machine IP 2. Click Open 4. Then, you will see the prompt.

  7. Environment • Caution! • After accessing your machine, • Change the password of your machine using ‘passwd’ • Basically, it is ‘monday or tuesday or thursday’. However, it is too easy, right? • Never reboot, or shutdown! • … sorry for this. Someone else might use your machine.

  8. Basic Commands & Shell • What is Shell? • Command Interpreter • Connecting User and Kernel • Monitoring Status of Machine • Not only executing simple commands such as cp, mkdir,,,, • You can see more than you expect • Species : Bash, Csh, Ksh, Zsh…. • We will use Bash!

  9. Basic Commands & Shell • What is Shell? • Command Interpreter • Connecting User and Kernel • Monitoring Status of Machine • Not only executing simple commands such as cp, mkdir,,,, • You can see more than you expect • Species : Bash, Csh, Ksh, Zsh…. • We will use Bash!

  10. Basic Commands & Shell • Commands on Shell • Simple Commands • cp, rm, mkdir, rmdir, mv, ln, ls (FILE) • more, cat, grep, dmesg (print out on console) • ps, w, top, uname, whoami, date, uptime (system state) • chown, chmod (authorization) • useradd, userdel, passwd (users) • Ping, ifconfig, netstat, route, iptables (network) • AND SO ON… Lots of things are there~

  11. Basic Commands & Shell • Shell Script (Very Much Important for this lab) • It is a file usually named xxx.sh • Should do `chmod 755 xxx.sh` to execute it. • Always start with #!/bin/bash (when using bash) • Similar with C programming • For do done : irritation • If then fi : condition • Echo ~= printf • Can execute commands of shell • Cd, cp, mkdir ….

  12. Basic Commands & Shell • Shell Script (Very Much Important for this lab) • Examples shown in the material • Changing gif -> jpg • Googling as much as you can. #!/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 ${filename%$1}$2 # 파일 이름에서 첫 번째 인자 부분을 떼어내고 두 번째 인자를 붙인다. done

  13. About Kernel • What is Kernel? • Core Part of OS • Managing and monitoring resources • Allocating resources to users • Deal with Process, File System, Memory, Network…

  14. About Kernel • Kernel Compiling • Why do we need Compiling of Kernel? • To use some special features of devices, options usually disabled in default should be enabled. • For the light environment such as Embedded System, we should minimize the kernel as much as possible. • Fast Booting Time • Avoid to execute processes which will never be used. Options for Linux Kernel -> After executing ‘make menuconfig’

  15. About Kernel • Steps for Kernel Compiling • Kernel Configuration • Make Menuconfig • Check Dependencies • Make Dep • Kernel Compile • Make bzImage or Make install • Module Compile and Install • Make modules && make modules_install • Boot using the newly-created kernel. • Modify /boot/grub/grub.conf, then reboot. • Choosing the kernel version you want to boot with

  16. Summary of LAB1-1 • Prob1. Printing Out Directories as a tree structure. • Example result (tree command in linux) • Hints for Shell Script • Recursive! • For, if(to check it is directory or not), cd, let…

  17. Summary of LAB1-1 • Prob2. Automatic Backup using Script and Cron • Hints for Cron • Crond, crontab, (automatic execution) • Tar,gz (archiving) • Date (for filename indicating time information)

  18. Summary of LAB1-1 • Prob3. Measuring Network Performance • Ab result • Useful keyword • For, if • Grep • echo ….. >> result.txt

  19. Summary of LAB1-1 • Prob4. Imagine your own script! • Whatever you want • You can bring a script from web. • You should modify reasonably. • Also, you should notify what you’ve modified. • For all exp problems, • Ok to refer scripts from web or books • Modify as much as you can for your report. • You should understand every line of scripts

  20. Policies of LAB1-1 • Pre-Report • Individual Work • Due Date : Before you finish your experiment. • Main-Report • 1 per each group • Due Date : 3/4 • Grading Policy • Total 100 points • Average : 80 points • If there is no global policy, • Pre : 30%, Demo : 30%, Main & Source Code: 40% • Report Delay : 10%/day • Copy : 0 points without exception. (both sides)

  21. Thank You ! Please, check the board and reply your team information at the notice. (http://core.kaist.ac.kr/~EE505)

More Related