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

     1  package kernel
     2  
     3  import "github.com/icexin/eggos/drivers/clock"
     4  
     5  // called when go runtime init done
     6  func Init() {
     7  	clockTimeInit()
     8  	idleInit()
     9  	go runTrapThread()
    10  	go runSyscallThread()
    11  	bootstrapDone = true
    12  }
    13  
    14  func clockTimeInit() {
    15  	t := clock.ReadCmosTime()
    16  	baseUnixTime = t.Time().Unix()
    17  	clockBaseCounter = counter
    18  }