1 / 13

實作作業

實作作業. 程式作業一: 寫一個程式可以自檔案輸入各個 Process 之編號、 CPU Burst 、 Arrival Time 、及 Priority ,並依這些資訊模擬 FCFS 、 RR 、 Preemptive SJF 、 Non-Preemptive SJF 、 Priority 等 CPU Scheduling 。本題必須繪出 Gantt Chart ,計算每個 Process 之 Turnaround Time 及 Waiting Time 。 程式繳交日為開學後一個月左右,可使用任何電腦語言,任何作業系統均可。. 程式作業二:

Télécharger la présentation

實作作業

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. 實作作業 程式作業一: • 寫一個程式可以自檔案輸入各個Process之編號、CPU Burst、Arrival Time、及Priority,並依這些資訊模擬FCFS、RR、Preemptive SJF、Non-Preemptive SJF、Priority等CPU Scheduling。本題必須繪出Gantt Chart,計算每個Process之Turnaround Time及Waiting Time。 • 程式繳交日為開學後一個月左右,可使用任何電腦語言,任何作業系統均可。

  2. 程式作業二: 寫一個RS232通訊程式,它包含下列功能: 1.必須直接控制16550 Chip 之Registers來作送收資料動作,不可 以使用系統之Device Drivers。 2.需寫成中斷程式,以控制資料之傳送。 3.主程式與中斷程式間之送收資料必須使用Ring Buffer,以生產者/消費者模式處理。 4.可以設定RS232通訊參數。 按F3:Set Communication Parameters. 按F4:List Communication Parameters. 按F5:Save Communication Parameters. 5.可作Internal Loop back Test。 6.可作External Loop back Test。 7.由COM1送出data,COM2接收此data.

  3. 程式作業二: 程式繳交日為期中考後一週左右,原則上使用C語言,或可以自已寫中斷程式之語言,作業系統環境為MS/DOS。畫面為Double Windows,上半部顯示輸入之Message,下半部為收到之Message。

  4. 程式作業三: 續程式作業二,並將個人電腦模擬成終端機,它包含下列功能: 1.Function Keys: F1:Help. F2:Send XOFF Singal to remote site. F3:Set Communication parameters. F4:List Communication parameters. F5:Save Communication parameters. F6:Down load message from remote site and save to disk file. F7:Up load message that stored at PC file to remote site. F8:Change mode (Double windows or Single window). F9:Exit.

  5. 程式作業三: 2.有關檔案傳輸方面,可以將PC上之檔案內容經由RS232線,傳至另一端PC之檔案內,或顯示在螢幕。 3.傳送之檔案可以是ASCII or Binary file。 4.具有處理S/CTRL and Q/CTRL功能。 程式繳交日為期末考左右。

  6. 輸入檔定義 - Integer

  7. Method定義 • FCFS (First Come First Serve) • RR (Round Robin) • PSJF (Preemptive Shortest Job First) • NSJF (Non-preemptive Shortest Job First) • PP (Preemptive Priority) • ALL

  8. FCFS之處理 • 依arrival time先後次序處理 • 若arrival time相同時, 則依ProcessID由小至大依序處理。

  9. RR之處理 • 先依arrival time先後次序處理, 時候未到的Process不能Run。 • 若arrival time相同時, 則依ProcessID由小至大依序處理。 • Time out時, 若有新來的Process, 則讓新來的Process排在前面。 • 某個ProcessTime slice未用完就結束時, 必須讓下一個Process執行。

  10. PSJF之處理 • 由剩餘CPU Burst最小的Process先處理。 • 若剩餘的CPU Burst相同, 讓沒有用過CPU的先使用, 無法分別時則依arrival time小的先處理。 • 若剩餘CPU Burst相同且arrival time相同, 則依ProcessID由小至大依序處理。

  11. NSJF之處理 • 由CPU Burst最小的Process先處理 • 若CPU Burst最少的Process不只一個, 則依arrival time小的先處理 • 若CPU Burst及arrival time相同, 則依ProcessID由小至大依序處理。

  12. PP之處理 • Priority number小的代表Priority大 • 依Priority由大致小依序處理 • 若Priority相同,讓沒有用過CPU的先使用,無法分別時則依arrival time小的先處理 • 若Priority及arrival time均相同, 則依ProcessID由小至大依序處理

  13. P15 P62 3 2 輸出之規定 • Turn around time 及Waiting time • 同課本及講義 • Gantt chart • 可用圖解或文字表示 • 文字表示方式 ProcessID Time ProcessID Time … P15 3 P62 2 … • 圖解

More Related