Presentation is loading. Please wait.

Presentation is loading. Please wait.

Week Seven Agenda Announcements Link of the week Review week six lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming.

Similar presentations


Presentation on theme: "Week Seven Agenda Announcements Link of the week Review week six lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming."— Presentation transcript:

1

2 Week Seven Agenda Announcements Link of the week Review week six lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming deadlines Questions and answers

3 Link of the week http://www.kernel.org/ The Linux Kernel Archives web site http://www.kernelnewbies.org/ This web site is a community of people that want to improve or update their kernels. This site is referenced by experienced developers willing to share their knowledge. Define: kernel is the central component of most operating systems. It is responsible for managing the system’s resources and the communications between hardware and software. Legacy terms: nucleus or core The kernel connects the application software (shell) t the hardware of the computer. Linux is portable to most 32 or 64 bit architectures.

4 Link of the week Define: Kernel space is space allocated specifically for the kernel. Users are not able to access this area. This area is generally larger than user space. The kernel is never swapped out to disk. Define: User space is space in memory where all user mode applications execute. Applications executing in this space are subject to being swapped out to disk. Define: monolithic kernel is where all code is executed in kernel addresses space to increase the performance of the system. Define: microkernel uses system calls to implement minimal OS services such as memory management, multitasking, and inter process communication.

5 Link of the week http://vista.intersystems.com/csp/docbook/DocBoo k.UI.Page.cls?KEY=GCI_unixparms#GCI_unixp arms_notes_hpux Calculating System Parameters for UNIX and Linux Configure Unix Kernel Parameters Swap space Number of global/routine buffers Number of users Number of inodes Maximum database size Number of semaphores

6 Review week six lab assignment makefile rule has the following format: target : prerequisites (dependencies) commands_1 commands_2 Target is typically the name of the file to be generated. A target may also be an action to be performed. Prerequisites are files that this target depends on. command_n are the SHELL commands necessary to produce the target (one command per line). Each line MUST be prefixed with a TAB. Any other spacing will cause your script not to execute.

7 Review week six lab assignment prog :a.o b.o c.o g++ a.o b.o c.o -ly –o prog a.o : prog.h a.c g++ –c prog.h a.c b.o :prog.h b.c g++ –c prog.h b.c c.o : c.c g++ –c c.c c.c : c.y yacc c.y mv y.tab.c c.c

8 Review week six lab assignment What is a dependency between source files? main.cpp  employee.cpp  address.cpp Some source files depend on other source files. What are the two parts of a dependency rule? 1) What files a file is dependent on 2) Rule that tells how to recompile the file What part of the dependency line is considered the target? What is considered the action line? We use the –c option on g++ to compile the source files to create object files. We use the –o option to create the executable program from the object files.

9 Review week six lab assignment Linker combines a number of object and archive files, relocates their data and ties up symbol references. Usually the last step in compiling a program is to run linker. Link object files into an executable whose name is “myProgram” g++ -o myProgram a.o b.o c.o.cpp is C++ source code file format Compile source code main.cpp g++ -c main.cpp

10 Review week six lab assignment Installing the software package Package manager Ant is extended using Java classes and written in XML. Manual makefile configure Source(s) code  compiler  Object Module(s)  linker  Load Module  loader What are the differences between a makefile and a shell script? The rules in the makefile are executed based upon dependency, and not sequential order. The “make” utility performs a recursive decent through the target tree building the lowest level targets first. A target is rebuilt if any of its prerequisites have a newer timestamp than itself.

11 Review week six lab assignments prog a.o b.o c.o a.c prog.h b.c c.c c.y

12 Review week six lab assignments

13 Review week six lab assignment 1. touch everything - everything should build g++ -c main.cpp g++ -c employee.cpp g++ -c address.cpp g++ -o myProgram main.o employee.o address.o 2. touch nothing - nothing should build make: `myProgram' is up to date. 3. touch address.h - main and employee should build g++ -c employee.cpp g++ -o myProgram main.o employee.o address.o 4. touch main.cpp - only main.o should build g++ -c main.cpp g++ -o myProgram main.o employee.o address.o 5. touch employee.cpp - only employee.o should build g++ -c employee.cpp g++ -o myProgram main.o employee.o address.o 6. touch address.cpp - only address.o should build g++ -c address.cpp g++ -o myProgram main.o employee.o address.o Removing myProgram and all object files (.o)

14 Review week six lab assignment Package Install Instructions With SFU 3.5 all "/Tools" applications are being packaged and we keep updating the versions too. A package is used by the installer to correctly place all the binary and data files. It also records version numbers, file locations and check sums for verification, uninstalls and does version updates. By using the installer all other packages that a particular application depends on will be installed at the same time. The installer is based on the BSD package system. We have made several changes and updates to it over the years, but it has essentially the same "flavor" as installers with BSD or Sun. The first thing to do to is "bootstrap" the installer to your system. If you have a 32-bit system (most people do) then download the Bootstrap installer (x86) file. If you have a 64-bit system (AMD64, not IA64) then download the Bootstrap installer (AMD64) file. If you have a 32-bit or 64-bit Vista system then download the Bootstrap installer (Vista) file. The installer can be run by the Administrator or by a member of the Administrators group. This file is a self-installing shell script. So run it as:Bootstrap installer (x86)Bootstrap installer (AMD64)Bootstrap installer (Vista)

15 Review week six lab assignment % sh pkg-current-bin35.sh or % sh pkg-current-bin52authenticamd.sh or % sh pkg-current-bin60.sh Doing an Installation To install a package use the pkg_update utility. For example, if you wish to install bash you will enter the following command: pkg_update -L bash This command will automatically download and install the most current bash package. If the package needs to have another package installed with it, that package will be downloaded and installed too. Pkg_update also takes care of which machine architecture you are using and what is the most current version of the software.

16 Review week six lab assignment What's Installed, Removing an Installation To view all of the current packages installed use the pkg_info command. To remove a package use the pkg_delete command. You do not need to know the version to delete a package. You can delete it easily as: % pkg_delete -M bash (The '-M' reduces your typing). Refer to the man pages for more information.

17 Review week six lab assignment Available Packages You can find a list of all of the available packages on the /Tools Warehouse web page: http://www.interopsystems.com/tools/warehouse.aspx. (Requires login.) This list continues to have new packages added and current packages updated with newer versions. When an updated release of a package is available we announce it through the /Tools Warehouse Updates Forum. To install an updated package you give the same command as when you installed it originally (more information on this further down the page). The installer will remove the older version for you before installing the newer version. Any changes in package dependencies will be handled at the same time. If you have already installed the most current version of a package the installer notices this and will leave things alone. http://www.interopsystems.com/tools/warehouse.aspx.Warehouse Updates

18 Review week six lab assignment Package Licensing The licensing terms for each package can be easily viewed from the /Tools Warehouse web page before you decide to download by selecting the src directory. It is important for you to understand that there are many different licenses used. Our preference is to use Full Open License software such as BSD and MIT. We do have many packages that are GPL or LGPL that may place restrictions on what you may do with a package's utilities and/or libraries. There are other licenses with unusual but not onerous conditions such as the Beer-Ware License (you agree to buy the author a beer if you ever meet him). We do release copies of the source code for most of the packages here.here

19 Review week six lab assignment Installation Recommendations We recommend that you always install a package with the command pkg_update -L {name} because this will provide to you the most trouble-free installation since so many packages are dependent on other packages. This also ensures you of getting the most current release of a package and avoiding an unnecessary download. Regularly checking for updates is very important for bug and security fixes. Several times people have reported that they are having a problem with a package that they downloaded 30 to 40 days ago. During that time the problem has been fixed. Checking for updates for all installed packages is easily done using the command: pkg_update -La These installations and updates are done over the Internet and packages are not stored on your system -- this helps keep more free disk space on your local system.

20 Review week six lab assignment Doing an Install There are two ways to do an installation now. You can make your choice based on what type of installation you are going to do. For the multiple versions of Interix and multiple hardware platforms we strongly recommend you stick with pkg_update for single or multiple packages. Administrators will want to keep users using pkg_update. pkg_add Install The pkg_add utility is the "older" tool that we suggest you avoid using directly. You can use it when you have a specific package you want to install (such as an older archived version for comparison). You may always refer to the pkg_add manual page for more information. We always recommend that you install a package as: pkg_update -L {name} where "{name}" is the package name. No need for a version number. The current version number will be discovered. This means you get the most recent/current version without having to worry about a numbering scheme.

21 Review week six lab assignment pkg_update Install When you want to install a group of packages, you want to check that all currently installed packages are up-to-date. To do an automated check for new packages then pkg_update is the tool for you to use. You may always refer to the pkg_update manual page for more information. New Interix users usually want to install a group of packages to match their profile. Currently three profiles exist: user, developer and administrator. their profiles may be added in the future based on /Tools member feedback (i.e. you!). By using a profile, a large number of packages can be selected and installed at one time. You can do the installations easily as: user: pkg_update -A developer: pkg_update -D administrator: pkg_update -G

22 Review week six lab assignment Large Administration Administrators of several machines usually want to control what software can be installed or updated. Administrators usually like to test and validate software (for a multitude of reasons that we won't cover here) before making this software available to their users. We understand the needs for this requirement and want to help. This control can be done setting these conditions: 1. Cache packages you have validated on a local network drive. 2. Create your own "list" file in the cache directory with 'tags'. 3. Set the PKG_LOCATION and PKG_PATH environment variables to this network drive on each system for members of the administrators group. 4. Have members of the administrators group only use pkg_update for installations and updates.

23 Review week six lab assignment Problems, Bugs, Your Suggestions If you encounter a problem installing a package please check that you are installing the most recent version of the package. The installer itself receives regular updates too. So keeping the installer up-to-date will help too. If you still have the problem please let us know either in one of the Forums or by e-mail: tools@interopsystems.com. The sooner the problem is fixed the less chance that another person will have to face the same problem. The installer can update itself. We recommend that when a new version is announced you update to that version. You can safely update the installer by doing: pkg_update -L pkg If you already have the current version the installer will notice and leave things as they are. If you have a suggestion for a package please let know. The list of packages has been developed by the requests of Interix users. We can't promise that it will get done immediately but it will be added to the "TO DO" list.tools@interopsystems.com

24 Review week six lab assignment Frequently Asked Questions I'm behind a firewall / I use an FTP Proxy I'm not allowed to use FTP I tried to install package XXXX and it failed How can I avoid always typing "ftp://ftp.interopsystems.com/pkgs/3.5" Can I save the packages locally and install them? Can't find package "env_XXX-bin.tgz" when installing another package Can I create my own package?

25 Week seven expected outcomes Upon successful completion of this module, the student will be able to: Create make file scripts for software programs. Use pattern rules in make files. Create an effective PowerPoint presentation. Create make files with multiple targets. Install software packages on a server.

26 Next lab assignment Links can be viewed as entries in a directory that reference other files. In UNIX we can create two types of links: Physical (hard) links Symbolic (soft) links

27 Next lab assignment A Physical Link references the exact same file (inode) as the file entry itself. An inode is a unique number assigned to a file by the file system. A file name in a directory can be viewed as a physical link and is no different than any other physical link. A directory is a list of physical links. ln test_file_1 test_file_hard_link ls –li (long listing with inodes) ls –i

28 Next lab assignment A Symbolic Link references a “pointer file” which has its own inode The pointer file points to the directory entry that references the target file (inode) The inode for the symbolic link and the target are different.

29 Next lab assignment Every file is associated with one inode. The inode contains the following information: file mode count of hard links owner id group id time of last file access time of last file modification file size file addresses

30 Next lab assignment

31 The directory maps file names to inodes. Each file has one inode. The number of inodes is a kernel parameter value. Each file may have more than one directory entry. Inodes contain a list of disk block addresses.

32 Next lab assignment

33 When there are multiple hard links, more directory entries point to the same inode (same file name) An inode can only hold a fixed number of direct data block addresses (10 for Linux). Large files use indirect block addresses. The inode keeps a count of the number of hard links that point to it. Deleting a file deletes and entry from the directory you are viewing it in. If the number of hard links is 1, removing or deleting that file will also delete the inode.

34 Next lab assignment

35 Inode 300 isn’t concerned about symbolic link 555 The symbolic link isn’t updated even if “your file” is deleted. ln –s test_file_1 test_file_symbolic_link

36 Next lab assignment Define: tar tar –cf newpack.tar /export/home/dandrear tar –xvf origpack.tar tar –tvf origpack.tar Define: gzip gzip filename.tar gzip –d filename.tar.gz gunzip filename.tar.gz Define: bzip2 / bunzip2 bzip2 filename.tar bunzip2 –d filename.tar.bz2

37 Break-out problems awk Algorithm Semaphore Tunable UNIX Parameters Block (chunk of data) Call by value Call by reference Interpreter Pointer (Perl) Shared memory

38 Upcoming deadlines makefile Exercise, 6-1 is due 10/21/08. Programming Assignment 1, 5-1 is due 10/28/08. Installation Exercise, 8-1 is due 11/14/08. Startup/Shutdown Exercise, 9-1 is due 11/11/08. Programming Assignment 3, 14-1 is due 12/16/08 (presentations).

39 Questions and answers Questions Comments Concerns I am available after this Franklin Live session to discuss any problems and/or concerns regarding the lab assignments

40


Download ppt "Week Seven Agenda Announcements Link of the week Review week six lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming."

Similar presentations


Ads by Google