From 7001ba42220be1425afa5f691ec565edefbfeef3 Mon Sep 17 00:00:00 2001 From: ytshih Date: Sat, 26 Apr 2025 08:37:30 +0800 Subject: [PATCH] Chore: update README.md --- README.md | 2 +- code/machine/mipssim.cc | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 983e3a7..8c7479c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Intro. to OS HW1 +# Introduction to OS 2024 HW ## Docker Compose usage diff --git a/code/machine/mipssim.cc b/code/machine/mipssim.cc index 16d3092..047ac3f 100644 --- a/code/machine/mipssim.cc +++ b/code/machine/mipssim.cc @@ -56,19 +56,19 @@ class Instruction { void Machine::Run() { - Instruction *instr = new Instruction; // storage for decoded instruction + Instruction *instr = new Instruction; // storage for decoded instruction - if (debug->IsEnabled('m')) { - cout << "Starting program in thread: " << kernel->currentThread->getName(); - cout << ", at time: " << kernel->stats->totalTicks << "\n"; - } - kernel->interrupt->setStatus(UserMode); - for (;;) { - OneInstruction(instr); - kernel->interrupt->OneTick(); - if (singleStep && (runUntilTime <= kernel->stats->totalTicks)) - Debugger(); - } + if (debug->IsEnabled('m')) { + cout << "Starting program in thread: " << kernel->currentThread->getName(); + cout << ", at time: " << kernel->stats->totalTicks << "\n"; + } + kernel->interrupt->setStatus(UserMode); + for (;;) { + OneInstruction(instr); + kernel->interrupt->OneTick(); + if (singleStep && (runUntilTime <= kernel->stats->totalTicks)) + Debugger(); + } }