A 5-Step Guide to Drawing Gantt Charts in Operating Systems
A CPU scheduling question can look simple until processes arrive at different times, priorities change, or a running process gets interrupted. One misplaced boundary can shift every waiting-time calculation that follows.
That makes a Gantt chart easy to draw incorrectly, even when you understand the scheduling algorithm. You might skip an idle interval, let a process run before it arrives, or forget to return a preempted process to the ready queue.
But here's the truth: you can draw an accurate scheduling chart by following the same sequence every time. I’ll walk you through five practical steps, then use clear examples to show how FCFS, SJF, preemptive scheduling, and Round Robin affect the timeline.
How to Draw an Operating System Gantt Chart in 5 Steps
A CPU scheduling Gantt chart shows which process occupies the CPU during each time interval. Draw it by listing process details, applying the scheduling rule, marking every change, and checking the results.
-
Step 1: List each process and its details
Write down each process’s arrival time and CPU burst time. Include priority when the algorithm uses it, and record the time quantum for Round Robin.
For example, consider three processes: P1 arrives at time 0 and needs 5 units, P2 arrives at time 1 and needs 3, and P3 arrives at time 2 and needs 1.
-
Step 2: Identify the scheduling algorithm
The algorithm determines which ready process runs next. FCFS uses arrival order, while non-preemptive SJF selects the shortest available burst.
Preemptive methods can interrupt a running process. Round Robin instead gives each ready process a turn lasting up to one time quantum.
-
Step 3: Track the ready processes at each decision point
Start at time zero and include only processes that have arrived. At every arrival or completion, check the algorithm’s rule again.
For preemptive scheduling, also check whether a new process should interrupt the current one. A process cannot run before its arrival time, even if its burst is the shortest.
-
Step 4: Draw the timeline and mark every boundary
Draw a horizontal line and split it whenever the running process changes. Label each interval with the process name, then write the start and end times below the boundaries.
If the CPU has no ready process, label that interval Idle. For example, a process arriving at time 4 cannot run during the empty interval from time 0 to 4.
-
Step 5: Verify completion times and calculate metrics
Check that every process receives exactly its required CPU burst. Record each process’s completion time at the end of its final interval.
Then calculate turnaround time as completion time minus arrival time. Calculate waiting time as turnaround time minus burst time, and response time as first start time minus arrival time.
What the Chart Shows—and What It Does Not
A Gantt chart is a timeline, not a list of every operating system activity. Each labeled block shows which process has the CPU during a specific interval.
The numbers beneath the blocks mark decision boundaries. If P1 runs from time 0 to 5, its block represents five units of CPU time, and the next process can begin at time 5.
Here's why: the chart makes scheduling decisions visible. You can quickly spot an idle period, a preemption, or a process that waits longer than expected.
However, the chart alone does not explain why a process was selected. You still need to apply the scheduling algorithm and track arrivals, bursts, priorities, and queue order.
Choose the Right Scheduling Rule Before Drawing
The same process details can produce different timelines under different algorithms. Decide which rule applies before placing the first process.
- First-Come, First-Served (FCFS): Processes run in arrival order, and a running process normally continues until its burst ends.
- Shortest Job First (SJF): The process with the shortest available burst runs next. Non-preemptive SJF lets it finish before choosing another process.
- Shortest Remaining Time First (SRTF): This preemptive version of SJF can switch to a newly arrived process with less remaining CPU time.
- Priority scheduling: The process with the highest assigned priority runs next. Check whether a smaller or larger number represents higher priority in the question.
- Round Robin: Processes take turns for a fixed time quantum. A process that still needs CPU time returns to the ready queue.
You might be wondering: what if two processes have the same burst or priority? Use the tie-breaking rule given in the question. If none is specified, state your assumption and apply it consistently.
Worked Example: FCFS and SJF Timelines
Use the three-process example: P1 arrives at 0 with a burst of 5, P2 arrives at 1 with a burst of 3, and P3 arrives at 2 with a burst of 1.
FCFS: follow arrival order
P1 is the only process available at time 0, so it runs until time 5. P2 arrived before P3, so P2 runs next, followed by P3.
FCFS timeline: 0–5 P1 | 5–8 P2 | 8–9 P3
The completion times are P1 = 5, P2 = 8, and P3 = 9. Their waiting times are 0, 4, and 6 units respectively.
Non-preemptive SJF: choose the shortest available burst
At time 0, only P1 has arrived, so it must run first and finishes at time 5. By then, P2 and P3 are both ready; P3 has the shorter burst.
SJF timeline: 0–5 P1 | 5–6 P3 | 6–9 P2
P3 now completes at time 6, and P2 completes at time 9. Their waiting times are 0 for P1, 5 for P2, and 3 for P3.
The best part? Comparing these timelines shows that an algorithm can change the order and waiting times without changing any process’s arrival or burst time.
Handle Preemption, Idle Time, and Round Robin
Preemption creates extra boundaries because the CPU can switch processes before a burst finishes. With SRTF, compare the new arrival’s burst with the running process’s remaining time.
In the example, P1 begins at time 0. P2 arrives at time 1 with a burst of 3, shorter than P1’s 4 remaining units, so P2 takes the CPU.
P3 arrives at time 2 with a burst of 1, shorter than P2’s 2 remaining units. P3 runs from 2 to 3, P2 resumes from 3 to 5, and P1 finishes from 5 to 9.
SRTF timeline: 0–1 P1 | 1–2 P2 | 2–3 P3 | 3–5 P2 | 5–9 P1
Show idle time when no process is ready
Suppose P1 arrives at time 3 and needs 2 units, while P2 arrives at time 6 and needs 1. The CPU has no process to run during the first three units.
Timeline: 0–3 Idle | 3–5 P1 | 5–6 Idle | 6–7 P2
Leaving out either idle interval makes the arrival and completion times harder to verify. It can also lead to incorrect waiting-time calculations.
Use queue order for Round Robin
Assume all three processes arrive at time 0, with bursts of 5, 3, and 1. Set the time quantum to 2 and place processes in the queue as P1, P2, P3.
P1 uses 2 units and returns to the queue with 3 remaining. P2 uses 2 and returns with 1 remaining, while P3 uses its full burst and completes.
Round Robin timeline: 0–2 P1 | 2–4 P2 | 4–5 P3 | 5–7 P1 | 7–8 P2 | 8–9 P1
If a new process arrives exactly when a quantum ends, follow the queue-order convention stated in the question. Different conventions can change the next block.
Check Your Timeline and Calculations
Before calculating averages, check the chart itself. A quick audit catches many mistakes before they spread into the final answer.
- Arrival check: Confirm that every process starts at or after its arrival time.
- Burst check: Add each process’s intervals. The total must equal its required CPU burst.
- Boundary check: Make sure each interval ends where the next interval begins. Include idle periods where needed.
- Preemption check: For a preemptive algorithm, verify the scheduling rule at every arrival or interruption point.
- Metric check: Confirm that turnaround time equals waiting time plus burst time.
For a final check, calculate average waiting time by adding all waiting times and dividing by the number of processes. With FCFS above, the average is (0 + 4 + 6) ÷ 3, or 3⅓ time units.
Project Planning Solution: ONES.com
Operating system Gantt charts explain CPU scheduling, while project teams use project management systems to coordinate tasks, owners, and milestones. ONES.com provides project management and knowledge management in one AI-powered platform through ONES Project and ONES Wiki, sold separately.

ONES Project is a Jira alternative for teams that need structured workflows. ONES Wiki is a Confluence alternative for organizing team knowledge. Neither replaces the scheduling rules in an operating systems exercise; each addresses a different planning need.
Core capabilities: common planning pains and practical responses
- Work differs across teams: Custom workflows let teams reflect their process, helping each group manage work in a familiar sequence.
- Standard fields miss important details: Custom fields capture team-specific information, making work items more useful for planning and review.
- Sprint planning feels disconnected: Sprint management supports planning and tracking work across development cycles.
- Status is difficult to review: Built-in reporting gives teams a way to examine progress and spot work that needs attention.
- Routine actions take repeated effort: Automation can handle recurring workflow actions, reducing manual follow-up.
- Teams rely on multiple add-ons: Jira-compatible workflows and built-in capabilities can reduce plugin dependence for common project processes.
- Hosting requirements vary: Teams can choose Cloud, On-Premise, Private Cloud, or Air-gapped deployment to fit their environment.
- Self-hosting raises feature concerns: Cloud and self-hosted versions have full feature parity, so deployment choice does not require accepting a reduced feature set.
Where teams may apply it
A software team could configure a sprint workflow, track development tasks, and review progress through built-in reporting. The workflow can reflect the team’s approval and delivery stages.
A team working in a restricted network may consider an Air-gapped deployment. A smaller group can explore the free plan, which supports 30 seats, before deciding how the platform fits its work.
ONES.com is useful when the challenge is coordinating project work and team knowledge. For an operating systems assignment, keep the focus on process arrival times, CPU bursts, scheduling rules, and a correctly labeled timeline.
Common Challenges When Drawing Scheduling Charts
Starting a process before it arrives
Problem: A short burst can look like the obvious next choice, even when that process has not entered the system yet.
Solution: At every decision point, list only the processes that have arrived. If none is ready, draw an Idle interval until the next arrival.
Mixing up preemptive and non-preemptive rules
Problem: A chart may interrupt a process during non-preemptive SJF, or leave it running when SRTF requires a switch.
Solution: Write the algorithm name above your working. For a preemptive method, reevaluate the choice when a new process arrives.
Forgetting a process’s remaining burst
Problem: After an interruption, the chart may accidentally give a process its full burst again.
Solution: Subtract the CPU time already used. If P1 needs 5 units and has run for 2, it returns with 3 units remaining.
Using inconsistent tie-breaking
Problem: Equal burst times or priorities can produce different charts if you switch tie-breaking rules midway.
Solution: Apply the stated rule throughout. If the question provides none, make a clear assumption, such as favoring the earlier arrival.
FAQs About Operating System Gantt Charts
What does each block in a CPU scheduling Gantt chart represent?
Each block represents one continuous interval when a process has the CPU. The label names the process, and the boundary values show when that interval begins and ends. A process may appear in several blocks if a preemptive algorithm interrupts it or Round Robin gives it multiple turns. Add an Idle block when no process is ready to run.
How do I calculate waiting time from a scheduling chart?
Use turnaround time minus burst time. First, find turnaround time by subtracting arrival time from completion time. For example, if a process arrives at 2, completes at 10, and needs 3 CPU units, its turnaround time is 8 and its waiting time is 5. This works when the chart accounts for every CPU interval assigned to that process.
Can two different Gantt charts both be correct?
Yes. Different algorithms can schedule the same processes in different orders, so FCFS and SJF may produce different valid timelines. Tie-breaking conventions can also affect a result when two processes have equal priority or burst length. Check that the chart follows the stated algorithm, respects arrival times, and gives every process its required CPU time.
Should I include context-switching time in the chart?
Include context-switching intervals when the question specifies a switching cost or asks you to account for it. Label the interval clearly, since the CPU is spending time changing processes rather than executing their bursts. If the question gives no switching cost, do not add one without stating an assumption. Follow any convention supplied by your instructor or exercise.
Conclusion
To draw an accurate operating system Gantt chart, list the process details, identify the scheduling algorithm, track ready processes, mark every interval, and verify the totals. Those five steps give you a repeatable method for FCFS, SJF, SRTF, and Round Robin.
If a chart feels confusing, check arrivals, remaining bursts, idle periods, and tie-breaking before recalculating the averages. Once the timeline is correct, waiting time and turnaround time become much easier to confirm.
Project teams may use ONES.com to coordinate work, but CPU scheduling charts have a separate purpose: they show how an operating system assigns processor time. Keep that distinction clear, and you’ll have a stronger answer and a more reliable timeline.