操作系统实验一报告.doc_第1页
操作系统实验一报告.doc_第2页
操作系统实验一报告.doc_第3页
操作系统实验一报告.doc_第4页
操作系统实验一报告.doc_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

实验目的:了解和操作线程和进程的概念,熟悉linux下的命令,熟悉vi编辑,gcc编译,gdb调试实验思想: 线程与进程实现结果:1.cat : 把档案串连接后传到基本输出(萤幕或加 fileName 到另一个档案)cd dirName 变换工作目录至 dirName。 其中 dirName 表示法可为绝对路径或相对路径。若目录名称省略,则变换至使用者的 home directory (也就是刚 login 时所在的目录)。chmod Linux/Unix 的档案调用权限分为三级 : 档案拥有者、群组、其他。利用 chmod 可以藉以控制档案如何被他人所调用。cp 将一个档案拷贝至另一档案,或将数个档案拷贝至另一目录cut cut -cnum1-num2 filename 显示每行从开头算起 num1 到 num2 的文字find 将档案系统内符合 expression 的档案列出来ln 硬连结的意思是一个档案可以有多个名称,而软连结的方式则是产生一个特殊的档案,该档案的内容是指向另一个档案的位置ls 显示指定工作目录下之内容(列出目前工作目录所含之档案及子目录)。more 一页一页地显示更多内容mv 将一个档案移至另一档案,或将数个档案移至另一目录。rm 删除档案及目录rmdir 删除空的目录touch 指令改变档案的时间记录at linux at命令允许相当复杂的时间指定cal l 日历命令,可以显示当月日历、当年日历、指定月份年份的日历等。date 能够在shell上直接显示当前时间,根据选项参数可以根据指定格式输出。passwd 用来更改使用者的密码who 查看当前登录用户的情况mail 收发邮件命令talk 与其他使用者对谈wall 会将讯息传给每一个 mesg 设定为 yes 的上线使用者。write 传讯息给其他使用者kill 关闭进程ps 显示瞬间行程 (process) 的动态2.UID PID PPID C SZ RSS PSR STIME TTY TIME CMDzx 1521 1 0 19786 9012 1 22:21 ? 00:00:00 /usr/lib/evolution/evolution-data-server-2.28 -oaf-activate-iid=OAFIID:GNOME_Evolution_DataSzx 2562 1 0 6084 2748 0 22:51 ? 00:00:00 /usr/bin/gnome-keyring-daemon -daemonize -loginzx 2580 2556 0 6608 7028 1 22:51 ? 00:00:00 gnome-sessionzx 2611 2580 0 4114 3032 0 22:51 ? 00:00:02 /usr/bin/ibus-daemon -ximzx 2615 2580 0 821 360 0 22:51 ? 00:00:00 /usr/bin/ssh-agent /usr/bin/dbus-launch -exit-with-session gnome-sessionzx 2618 1 0 846 764 1 22:51 ? 00:00:00 /usr/bin/dbus-launch -exit-with-session gnome-sessionzx 2619 1 0 830 1520 1 22:51 ? 00:00:00 /bin/dbus-daemon -fork -print-pid 5 -print-address 7 -sessionzx 2620 2611 0 2263 3348 0 22:51 ? 00:00:00 /usr/lib/ibus/ibus-gconfzx 2622 2611 0 14567 28104 0 22:51 ? 00:00:06 python /usr/share/ibus/ui/gtk/main.pyzx 2624 1 0 4377 6136 1 22:51 ? 00:00:00 /usr/lib/ibus/ibus-x11 -kill-daemonzx 2627 1 0 2013 4456 0 22:51 ? 00:00:00 /usr/lib/libgconf2-4/gconfd-2zx 2629 2611 0 6450 10728 0 22:51 ? 00:00:01 /usr/lib/ibus-pinyin/ibus-engine-pinyin -ibuszx 2637 1 0 22417 9532 0 22:51 ? 00:00:00 /usr/lib/gnome-settings-daemon/gnome-settings-daemonzx 2640 1 0 1665 2348 0 22:51 ? 00:00:00 /usr/lib/gvfs/gvfsdzx 2646 2580 0 5185 8132 0 22:51 ? 00:00:00 gnome-power-managerzx 2647 2580 0 12438 12496 1 22:51 ? 00:00:00 nm-applet -sm-disablezx 2649 2580 0 12281 17776 0 22:51 ? 00:00:00 gnome-panelzx 2651 1 0 7570 2640 1 22:51 ? 00:00:00 /usr/lib/gvfs/gvfs-fuse-daemon /home/zx/.gvfszx 2653 2580 1 20211 25592 1 22:51 ? 00:00:11 /usr/bin/compizzx 2656 2580 0 28032 40612 0 22:51 ? 00:00:06 nautiluszx 2658 1 0 23908 4748 0 22:51 ? 00:00:05 /usr/bin/pulseaudio -start -log-target=syslogzx 2660 2580 0 5014 7956 0 22:51 ? 00:00:00 bluetooth-appletzx 2661 2580 0 4759 6328 0 22:51 ? 00:00:00 /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1zx 2680 2658 0 2688 2992 0 22:51 ? 00:00:00 /usr/lib/pulseaudio/pulse/gconf-helperzx 2681 1 0 1793 3100 0 22:51 ? 00:00:00 /usr/lib/gvfs/gvfsd-trash -spawner :1.8 /org/gtk/gvfs/exec_spaw/0zx 2684 1 0 955 1072 0 22:51 ? 00:00:00 syndaemon -i 0.5 -kzx 2686 1 0 8227 3904 0 22:51 ? 00:00:00 /usr/lib/gvfs/gvfs-gdu-volume-monitorzx 2688 1 0 10579 3668 0 22:51 ? 00:00:00 /usr/lib/bonobo-activation/bonobo-activation-server -ac-activate -ior-output-fd=19zx 2702 1 0 11332 15472 1 22:51 ? 00:00:02 /usr/lib/gnome-panel/wnck-applet -oaf-activate-iid=OAFIID:GNOME_Wncklet_Factory -oaf-ior-fdzx 2703 1 0 1834 2392 0 22:51 ? 00:00:00 /usr/lib/gvfs/gvfs-gphoto2-volume-monitorzx 2704 1 0 9570 11648 1 22:51 ? 00:00:00 /usr/lib/gnome-applets/trashapplet -oaf-activate-iid=OAFIID:GNOME_Panel_TrashApplet_Factoryzx 2706 1 0 4290 2348 0 22:51 ? 00:00:00 /usr/lib/gvfs/gvfs-afc-volume-monitorzx 2712 1 0 13549 14364 0 22:51 ? 00:00:00 /usr/lib/indicator-applet/indicator-applet-session -oaf-activate-iid=OAFIID:GNOME_FastUserSwzx 2713 1 0 9575 15052 1 22:51 ? 00:00:00 /usr/lib/gnome-panel/clock-applet -oaf-activate-iid=OAFIID:GNOME_ClockApplet_Factory -oaf-izx 2716 1 0 14291 13448 0 22:51 ? 00:00:00 /usr/lib/indicator-applet/indicator-applet -oaf-activate-iid=OAFIID:GNOME_IndicatorApplet_Fazx 2717 1 0 5948 9324 0 22:51 ? 00:00:00 /usr/lib/gnome-panel/notification-area-applet -oaf-activate-iid=OAFIID:GNOME_NotificationArezx 2731 1 0 4576 4532 1 22:51 ? 00:00:00 /usr/lib/indicator-messages/indicator-messages-servicezx 2732 1 0 1630 2024 1 22:51 ? 00:00:00 /usr/lib/gvfs/gvfsd-metadatazx 2734 1 0 21332 4576 0 22:51 ? 00:00:00 /usr/lib/indicator-sound/indicator-sound-servicezx 2736 1 0 6076 4312 1 22:51 ? 00:00:00 /usr/lib/indicator-application/indicator-application-servicezx 2737 2653 0 458 512 1 22:51 ? 00:00:00 /bin/sh -c /usr/bin/compiz-decoratorzx 2738 2737 0 6659 11804 0 22:51 ? 00:00:00 /usr/bin/gtk-window-decoratorzx 2744 1 0 4801 4952 1 22:51 ? 00:00:00 /usr/lib/indicator-me/indicator-me-servicezx 2746 1 0 4581 4860 0 22:51 ? 00:00:00 /usr/lib/indicator-session/indicator-session-servicezx 2757 1 0 1686 2452 0 22:51 ? 00:00:00 /usr/lib/gvfs/gvfsd-burn -spawner :1.8 /org/gtk/gvfs/exec_spaw/1zx 2773 1 0 4582 2740 0 22:52 ? 00:00:00 gnome-screensaverzx 2783 1 0 10325 12832 1 22:52 ? 00:00:00 /usr/lib/notify-osd/notify-osdzx 2867 2580 0 4915 7620 1 22:52 ? 00:00:00 /usr/lib/gnome-disk-utility/gdu-notification-daemonzx 2882 2580 0 8026 15624 1 22:52 ? 00:00:00 python /usr/share/system-config-printer/applet.pyzx 2883 2580 0 17280 11860 0 22:52 ? 00:00:00 /usr/lib/evolution/2.28/evolution-alarm-notifyzx 2889 1 0 19777 9000 0 22:52 ? 00:00:00 /usr/lib/evolution/evolution-data-server-2.28 -oaf-activate-iid=OAFIID:GNOME_Evolution_DataSzx 2893 1 0 9080 11536 0 22:52 ? 00:00:00 /usr/lib/evolution/2.28/evolution-exchange-storage -oaf-activate-iid=OAFIID:GNOME_Evolution_zx 2911 1 0 14425 16432 1 22:52 ? 00:00:02 gnome-terminalzx 2912 2911 0 497 712 1 22:52 ? 00:00:00 gnome-pty-helperzx 2913 2911 0 1600 3544 1 22:52 pts/0 00:00:00 bashzx 2934 2580 0 10397 13032 0 22:52 ? 00:00:00 update-notifierzx 3018 1 0 3842 3020 0 22:54 ? 00:00:00 /usr/lib/gvfs/gvfsd-computer -spawner :1.8 /org/gtk/gvfs/exec_spaw/2zx 3104 1 0 29947 49336 0 22:59 ? 00:00:02 evince /home/zx/桌面/到 操作系统 的链接/ass1.pdfzx 3106 1 0 1172 2024 0 22:59 ? 00:00:00 /usr/lib/evince/evincedzx 3274 1 1 60787 91996 0 23:00 ? 00:00:08 /usr/lib/openoffice/program/soffice.bin -writer /home/zx/桌面/到 操作系统 的链接/实验一指导.dzx 3312 1 0 458 560 1 23:02 ? 00:00:00 /bin/sh /usr/lib/firefox-3.6.8/firefoxzx 3317 3312 0 458 568 1 23:02 ? 00:00:00 /bin/sh /usr/lib/firefox-3.6.8/run-mozilla.sh /usr/lib/firefox-3.6.8/firefox-binzx 3321 3317 5 64232 69672 1 23:02 ? 00:00:18 /usr/lib/firefox-3.6.8/firefox-binzx 3341 3321 0 23776 21996 1 23:02 ? 00:00:01 /usr/lib/firefox-3.6.8/plugin-container /usr/lib/flashplugin-installer/libflashplayer.so 3321zx 3380 2957 0 1173 1672 0 23:03 pts/0 00:00:00 su zxzx 3389 3380 0 1599 3544 0 23:03 pts/0 00:00:00 bashzx 3433 3414 0 1176 1724 1 23:03 pts/0 00:00:00 su zxzx 3441 3433 0 1599 3548 0 23:03 pts/0 00:00:00 bashzx 3475 3441 0 679 1100 0 23:07 pts/0 00:00:00 ps -w -F -u zx3./实现交换a,b的数值#includeint main() int a,b,c; a = 1; b = 2; printf(a=%dn,a); printf(b=%dn,b); c = a; a = b; b = c; printf(after exchangedn); printf(a=%dn,a); printf(b=%dn,b); return 0;gdb 调试内容:(gdb) runStarting program: /home/zx/p1 Breakpoint 1, main () at p1.c:66 a = 1;(gdb) runThe program being debugged has been started already.Start it from the beginning? (y or n) nProgram not restarted.(gdb) next7 b = 2;(gdb) next8 printf(a=%dn,a);(gdb) nexta=19 printf(b=%dn,b);4编写一个控制台应用程序,命名为 an_ch2_1b。这个程序不断地输出如下行: Those output come from child,系统时间 另外写一个控制台应用程序,命名为 an_ch2_1a。这个程序创建一个子进程,执行 an_ch2_1b。这个程序不断地输出如下行: Those output come from child,系统时间 观察程序运行的结果,并对你看到的现象进行解释。 程序代码如下:/an_ch2_1a.c/调用子进程运行 an_ch2_1b#include #include #include int main() int pid; if(pid = fork() = 0) syst

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论