Lecture: interrupts and exceptions

Preparation

Virtual memory exercise recap

#include "types.h"
#include "user.h"

int
main(int argc, char **argv)
{
  int x, y, z;

  if (argc < 3){
    printf(2, "usage: div x y\n");
    exit();
  }
  x = atoi(argv[1]);
  y = atoi(argv[2]);
  z  = x / y;
  printf(1, "%d / %d = %d\n", x, y, z);
  exit();
}

Overview

x86 interrupt handling