Unit No: 5

Advanced Tools and Technologies Pavan R Jaiswal



Make tools ◦ make, nmake, cmake

    

AWK tool Grep, egrep, fgrep Sorting tools UEFI boot Case study of Fedora 19 EFI files ◦ Gcdx64.efi, grub.cfg, grubx64.efi ◦ MokManager.efi, ◦ Shim.efi, shim-fedora.efi

Advanced tools & technologies

29-Sep-15

2



It determines automatically which pieces of large

programs needs to be recompiled 

It issues the commands to recompile them.



Implemented by Richard Stillman, Ronald McGrath



Make specifies dependency between components



Usual way done is pavan@ubuntu~:$ ./configure && make && make install

Advanced tools & technologies

29-Sep-15

3



Scenario ◦ Large project contains thousands of lines of code ◦ Distributed in multiple files and developed by many developers

◦ Few components may have complex inter-dependencies ◦ Manually recompiling project is tedious job 

Solution ◦ Make utility

Advanced tools & technologies

29-Sep-15

4



  



In case of several source files, compiling source code is tedious Do you wish to avoid typing compiling commands? It is possible with the help of Makefile Makefile is special format file that together with make utility helps you to automatically build and manage your projects Makefile composed of target: dependencies [tab] system commands

Advanced tools & technologies

29-Sep-15

5

1.

module.h #include void sample_func();

2.

module .c #include “module.h” void sample_func(){ printf(“Hello World”); }

Advanced tools & technologies

29-Sep-15

6

3.

main.c #include “module.h” void sample_func(); int main(){ sample_func(); return 0; }



Compilation steps pavan@ubuntu~:$ gcc –I . –c main.c #obtain main.o pavan@ubuntu~:$ gcc –I . –c module.c #obtain module.o pavan@ubuntu~:$ gcc main.o module.o –o target_bin #obtain target binary Advanced tools & technologies

29-Sep-15

7



Prepare Makefile all: main.o module.o gcc main.o module.o –o target_bin main.o: main.c module.h gcc –I . –c main.c module.o: module.c module.h gcc –I . module.c clean: rm –rf *.o rm target_bin

Advanced tools & technologies

29-Sep-15

8



Processing Makefile pavan@ubuntu~:$ make gcc –I . –c main.c gcc –I . –c module.c gcc main.o module.o –o target_bin



Now add one more printf statement to module.c pavan@ubuntu~:$ make gcc –I . –c module.c gcc main.o module.o –o target_bin

Advanced tools & technologies

29-Sep-15

9

   

It is make utility provided by Microsoft Available in Visual Studio It is handy tool for creating automated builds Example ◦ “makefile” Foo.exe: foo.cs css foo.cs



To execute above makefile use ◦ nmake foo.exe

Advanced tools & technologies

29-Sep-15

10

  

  



It is cross platform, open-source build system Developed by Kitware It is family of tools designed to build, test & package software It controls software compilation process It generates native makefiles and workspaces Cmake is told the names of target to build, and the source file which belongs to particular target Eg. $ cmake /path/to/source/directory

Advanced tools & technologies

29-Sep-15

11

For more info on make and cmake, click here  Or copy paste below link into browser  http://www.pavanjaiswal.com/2015/0 9/make-and-cmake-utility-examplein-linux_22.html 

Advanced tools & technologies

29-Sep-15

12



Developed by- Aho, Weinberger, and Kernighan



Scripting language used for manipulating data and generating reports



It is mostly used for pattern scanning & processing



Key features ◦ Views text file as record and fields ◦ Has variables, conditions & loops ◦ Has arithmetic & string operators Advanced tools & technologies

29-Sep-15

13

Advanced tools & technologies

29-Sep-15

14



awk ‘/search pattern 1/ {actions} /search pattern 2/ {actions}’ file



Explanation o Search pattern is a regular expression o Actions – statement(s) to be performed o Several patterns and actions are possible in awk o File – input file o Single quotes around program is to avoid shell not to interpret any of its special characters Advanced tools & technologies

29-Sep-15

15

◦ if pattern is missing, action is applied to all lines

◦ if action is missing, the matched line is printed ◦ must have either pattern or action 

Contents of awk.test file 100 Pavan 50000 200 Ajay 45000



Example pavan@ubuntu~:$ awk ‘/Pavan/’ awk.test 100 Pavan 50000 Advanced tools & technologies

29-Sep-15

16



A field is a unit of data in a line



Each field is separated from the other fields by the field separator ◦ default field separator is whitespace



A record is the collection of fields in a line



A data file is made up of records

Advanced tools & technologies

29-Sep-15

17

Advanced tools & technologies

29-Sep-15

18



1.

awk supports two types of buffers: record and field field buffer: ◦ one for each fields in the current record. ◦ names: $1, $2, …

2.

record buffer : ◦ $0 holds the entire record

Advanced tools & technologies

29-Sep-15

19

FS - Field separator (default=whitespace) RS - Record separator (default=\n) NF - Number of fields in current record

NR - Number of the current record OFS - Output field separator (default=space)

ORS - Output record separator (default=\n) FILENAME - Current filename Advanced tools & technologies

29-Sep-15

20

1.

Default behaviour of awk pavan@ubuntu~:$ awk ‘{print}’ awk.test

2.

Print line which matches the pattern pavan@ubuntu~:$ awk ‘/Pavan/’ awk.test

3.

Print only specific field pavan@ubuntu~:$ awk ‘{print $2,$3}’ awk.test

4.

Find employee whose id is greater than 100 pavan@ubuntu~:$ awk ‘$1 > 100 {print $2}’ awk.test

Advanced tools & technologies

29-Sep-15

21



Where does the name come from? ◦ g/RE/p ◦ globally regular expression print



How it works? ◦ grep looks inside file(s) and returns any line that contains the string or expression

◦ prints lines matching a pattern to STDOUT

Advanced tools & technologies

29-Sep-15

22

 

grep Pattern grep pattern filename pavan@ubuntu~:$ grep ‘search’ testfile can be used to search patterns



grep pattern file1 file2 pavan@ubuntu~:$ grep ‘search’ testfile test testfile: can be used to search patterns test:



If grep cannot find a line in any of the specified files that contain the requested pattern, no output is produced. Advanced tools & technologies

29-Sep-15

23



$? is set to 0

◦ if grep finds something



$? is set to 1

◦ if grep finds nothing



$? is set to 2

◦ if one of the input file cannot be found.



Awk do not use the exit status to indicated the success or failure of locating a pattern. They report failure only if there is a syntax error in a command.

Advanced tools & technologies

29-Sep-15

24



Special case: fgrep fgrep STRING file1 file2 …

◦ Same as grep -F STRING file1 file2 … ◦ The STRING is a fixed string, not a REGEXP ◦ All meta characters are disabled – i.e. they are treated as themselves 

Example pavan@ubuntu~:$ fgrep ‘int’ main.c int main(){

Advanced tools & technologies

29-Sep-15

25



Special case: egrep egrep REGEXP file1 file2 … ◦ The meta characters ?, +, {, |, (, and ) have their special meanings  In grep (as opposed to egrep) these have no special meaning unless escaped with a backslash \

Advanced tools & technologies

29-Sep-15

26

   

Sort commands sorts a file according to fields Output from sort is printed to screen Output of sort can be redirected to a file Syntax $ sort [option] file



Example pavan@ubuntu~:$ sort testfile pavan@ubuntu~:$ sort -r testfile pavan@ubuntu~:$ sort testfile > outputfile

Advanced tools & technologies

29-Sep-15

27

  

 



Unified Extensible Firmware Interface Developed by Intel, managed by UEFI forum It is specification of BIOS successor with no restriction on running in 16-bit mode with 20-bit addressing It is used by many newer 64-bit systems Because of EFI, you no longer need a dedicated boot loader. For more details click here

Advanced tools & technologies

29-Sep-15

28

 









Gcdx64.efi – unsigned version of GRUB Grubx64.efi – this is main GRUB executable, signed with Fedora’s key Grub.cfg – configuration file which maintains GRUB details MokManager.efi – mok means machine owner key. This program enables you to add keys to MOK list from the EFI Shim.efi – this is version of shim signed with Microsoft’s key Shim-fedora.efi – this is unsigned version of shim

Advanced tools & technologies

29-Sep-15

29

1.

2. 3. 4. 5.

What is make utility? Explain it with example. Consider your own makefile. Explain with example Linux utilities – grep, egrep, fgrep and sort. What are the EFI and UEFI? Explain with an application. Explain in detail how to make USB bootable with any open source tool / utility? What is AWK scripting? Write an AWK script to print squares of numbers from 1 to 10 Advanced tools & technologies

29-Sep-15

30

6.

7.

8.

9.

What is secure boot? State the difference between BIOS and UEFI. What is grep utility? What are the grep variations? Explain with example.

What is AWK scripting? Write an AWK script to perform any 4 operations of your choice on student database. What is secure boot? State the difference between BIOS and UEFI. Advanced tools & technologies

29-Sep-15

31

1.

2.

3.

4. 5.

6.

Pramod Chandra P.Bhatt, “An Introduction to Operating Systems: Concepts & Practices”, 4th edition, PHI, ISBN 978-81-203-4836-3 http://www.opensourceforu.com/2012/06/gnu-make-indetail-for-beginners/ http://www.gnu.org/software/make/manual/make.html#Over view http://c2.com/cgi/wiki?UsingNmake http://msdn.microsoft.com/en-in/library/dd9y37ha.aspx http://www.pavanjaiswal.com/2015/09/make-and-cmakeutility-example-in-linux_22.html Advanced tools & technologies

29-Sep-15

32

7. 8.

9.

10.

11. 12.

http://www.cmake.org/ http://www.ogre3d.org/tikiwiki/tikiindex.php?page=getting+started+with+cmake http://www.thegeekstuff.com/2010/01/awkintroduction-tutorial-7-awk-print-examples/ http://www.chemie.fuberlin.de/chemnet/use/info/gawk/gawk_3.html http://www.computerhope.com/unix/usort.htm http://lowfatlinux.com/linux-sort.html

Advanced tools & technologies

29-Sep-15

33

13.

14.

15.

http://pavanjaiswal.blogspot.in/2014/08/detectingcomputer-is-booted-with-bios_5.html http://forums.fedoraforum.org/showthread.php?p=1 687941 http://www.ambitious-vision.net/en/fedora-18-andwindows-8-uefi-how-to/

Advanced tools & technologies

29-Sep-15

34

Thank you Personal website: http://www.pavanjaiswal.com

Advanced tools & technologies

29-Sep-15

35

Unit 5 Advanced Tools & Technologies.pdf

Page 2 of 35. Make tools. ◦ make, nmake, cmake. AWK tool. Grep, egrep, fgrep. Sorting tools. UEFI boot. Case study of Fedora 19 EFI files.

2MB Sizes 0 Downloads 122 Views

Recommend Documents

Unit 6 Advanced Tools Techniques.pdf
Managing hundreds or thousands of processors. ◦ Managing parallelization and distribution. ◦ I/O Scheduling. ◦ Status and monitoring. ◦ Fault/crash tolerance. MapReduce provides all of these, easily! Source: http://labs.google.com/papers/mapr

Unit 6 Advanced Tools and Technologies.pdf
Page 2 of 70. Contents. • Multiprocessor scheduling. • Real time scheduling. • Linux scheduling. • UNIX free BSD scheduling. • Windows vista scheduling.

Unit 5.pdf
Brindavan 13th c Govind Dev ... The 2 main components of the temple are : ... Whoops! There was a problem loading this page. Unit 5.pdf. Unit 5.pdf. Open.

Unit 5 Menu.pdf
2. Complete a paired “comunicación” section in the textbook. (5 pts each). Conversation Skill Builder. 3. Create Spanish dialogue between 2 or more characters ...

unit 5.pdf
A function code has been allocated to each service provided by INT ... (keyboard) and echoes (send) the character to the standard output device (monitor). It.

UNIT 5 VINODPADHYANI.pdf
Page 1 of 2. MADE BY A.K.PARMAR. विनोदऩधानी. બાલકન ુંનામ :-......................................................................................................ક ઱ ગણ :- ૨૦ ગણ. ઴ાલાન 

Unit-5.pdf
5.6 Targeted Public Distribution System (TPDS). 5.7 Food ... 5.8 Diversion from the PDS .... during 1951-2001. Page 3 of 44. Unit-5.pdf. Unit-5.pdf. Open. Extract.

Unit 5 Review.pdf
Page 1 of 2. Geometry - Unit 5 Review WS Name. Block ______. 1. Find the indicated trig ratios. a. tan A ______. b. sin C___________. c. cos C___________.

Unit 5 - Review.pdf
What is the percentile rank for a student finishing this test in 48 minutes? 5. The South Metro Fire Department claims to have collected information from 60 calls in a week and found response. times to be normally distributed with a mean of 6 minutes

CfE Advanced Higher Physics Unit 3: Electromagnetism
or transmitted in any form or by any means, without written permission from the publisher. Heriot-Watt University accepts no responsibility or liability whatsoever with regard to the information contained in this study guide. Distributed by the SCHOL

CfE Advanced Higher Physics Unit 3: Electromagnetism
Julie Boyle (St Columba's School). Reviewed by: ... Energy transformation associated with movement of charge . .... The unification of electricity and magnetism .

CfE Advanced Higher Physics Unit 3: Electromagnetism
played a significant part in the development of the standard model. ... In a Rutherford scattering experiment, a beam of alpha particles is fired at a sheet of.

CfE Advanced Higher Physics Unit 3: Electromagnetism
electromagnetic pumps have been used in medical physics to transport blood in heart- lung machines and artificial kidney machines. Blood transported in this way can remain sealed and so the risk of contamination is reduced. There is also less damage

Unit 5 FM3 Worksheet 5.pdf
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Unit 5 FM3 Worksheet 5.pdf. Unit 5 FM3 Worksheet 5.pdf. Open.

ICS-Unit 5.pdf
Page 1 of 29. Introduction to Control Systems. Control System means any quantity of interest in a machine or mechanism is maintained or altered in. accordance ...

unit-22 5- BY Civildatas.blogspot.in.pdf
Define slenderness ratio. (MAY/JUNE 12). Slenderness ratio of a column is defined as the ratio of effective length to corresponding radius. of gyration of the section. Thus. Slenderness ratio=le/r. Where,. le=effective length. r=appropriate radius of

Unit 5 Biochemistry esrmnotes.in.pdf
Page 1 of 67. BT1004 Biochemistry. UNIT V. • Introduction. • Bioenergetics, High energy compounds,. Biological oxidation. • Electron transport chain, Oxidative. phospholyration, Chemiosmotic theory. • Shuttle pathway – Glycerol phosphate. S

Unit 5 Identity Management Models.pdf
Identity Management. Current IdM solutions are mainly concerned with identities that are used by end users,. and services identify themselves in the networked ...

Unit 5 World History Packet.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Unit 5 World ...

Unit 5 focus wall posters.pdf
Page 2 of 56. The Unsinkable. Wreck of the R.M.S.. Titanic. by Robert D. Ballard and Rick. Archbold. Expository Text. 5-2. Page 2 of 56 ...

MP Unit-5 SE-II.pdf
Debugging and Virtual 8086 Mode. Mr. Sumit Shinde. Assistant Professor. Computer Engineering Department. Pune Institute of Computer Technology.

unit 5 in mis perspective
5.5 Framework for Understanding Management Information Systems ... The very first application of computers in business was to create a transaction processing ...

RE GIS unit (5)_NoRestriction.pdf
Spatial Data. 16,What are the types of spatial data models? . Raster. Vector . lmage. l7.Whal are the major data sources of GIS? o . Conventional analog map ...