實驗一 幾種操作系統的界面

一、目的和要求

  • 目的

本實驗的目的是使學生熟悉1—2種操作系統的界面,在熟練使用機器的基礎上,能瞭解各種操作命令和系統調用在系統中的大致工作過程。也就是通過操作系統的外部特徵,逐步深入到操作系統的內部實質內容中去。

  • 要求
  1. 能熟練的在1—2種操作系統的環境下工作,學會使用各種命令,熟悉系統提供的各種功能,主動而有效地使用計算機。
  2. 熟悉系統實用程序的調用方法和各種系統調用模塊的功能和作用

二、內容

在某種操作系統的環境下建立、修改、運行、打印源程序和結果,最後撤消一個完整的程序。

提示:可按下述步驟進行

  1. 編寫一個完整的源程序,通過編輯命令送入機器,建立源程序文件;
  2. 編譯該源文件,建立相應的目標文件;
  3. 編譯有錯時,再用編輯命令修改源文件,消除全部詞法和語法錯誤;
  4. 連接目標文件,形成可執行文件;
  5. 執行該文件,得到結果;
  6. 打印輸出源程序和運行結果;
  7. 撤消本次實驗中形成的所有文件。

試驗記錄:

     

This experiment is simple for step ,but we should via this experiment in order to strength our comprehension with the compile,load and link of process .

just compile a .cpp file use operator system.

from website ,we can find method that open DOS if some use windows os,and input g++ [the file's path and name].

I failed when I follows,Because my system path has no g++ or gcc exe files.

Search the reason for my failed ,the result is that I should download a app,I forgot the name of that app, but I have a compiler named DEV-C++,a compiler app for c++ and c.If DEV can compile the cpp of c files ,dev must have this gcc or g++ exe files,so I open the fold that comprise DEV,and then find the gcc file ,so I add the path of gcc to our system path ,which process can be found on website.

Try it success.

via series step ,I have new comprehension of compiler which we use but not notice.

C and C++ offer a header file to introduce library function.

There are system functions can't be used without the method called 'system call',such as print and input.

So if your procedure need this system functions ,this functions can be called only when you add the header file like '#include<stdio>' or '#include<iostream>'.

Naturally if procedure need no system function such as 

int i;
int j;
for(int i = 0;i<10;i++){
int x = i+j;
}

this situation,programmer can compiler it without link ,that means ,the header files will not be used;

The detailed process is ,firstly ,new a file ,edit your own C++ or C codes,and edit the suffix as .cpp (C++files) ,.c(Cfiles).

Don't forget the path of this file and file name!

then Win+R,input cmd,

input

      gcc a.cpp

OK

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章