github.com/icexin/eggos@v0.4.2-0.20220216025428-78b167e4f349/drivers/qemu/qemu.go (about)

     1  // Package qemu provides utility functions for interacting with the Qemu machine
     2  // emulator and virtualizer.
     3  package qemu
     4  
     5  import "github.com/icexin/eggos/kernel/sys"
     6  
     7  const (
     8  	// port used for Qemu exit commands.
     9  	qemuExitPort = 0x501
    10  )
    11  
    12  // Exit sends an exit command to Qemu with the given exit code.
    13  func Exit(code int) {
    14  	sys.Outb(qemuExitPort, byte(code))
    15  }