You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: backend.go
    path of file: ./repos/eggos/drivers/cga
    
    the code of the file until where you have to start completion: package cga

import (
	"unsafe"

	"github.com/icexin/eggos/drivers/cga/fbcga"
	"github.com/icexin/eggos/drivers/vbe"
	"github.com/icexin/eggos/kernel/sys"
)

type Backend interface {
	GetPos() int
	SetPos(pos int)
	// WritePos write char at given pos but not update pos
	WritePos(pos int, char byte)
	// WriteByte write char and advance pos
	WriteByte(ch byte)
}

const (
	
    
func (c *cgabackend) WriteByte(ch byte) {
	var pos int

	// Cursor position: col + 80*row.
	sys.Outb(CRTPORT, 14)
	pos = int(sys.Inb(CRTPORT+1)) << 8
	sys.Outb(CRTPORT, 15)
	pos |= int(sys.Inb(CRTPORT + 1))

	switch ch {
	case '\n':
		pos += 80 - pos%80
	case bs, del:
		if pos > 0 {
			pos--
		}
	default:
		// black on white
		crt[pos] = uint16(ch&0xff) | 0x0700
		pos++
	}

	// Scroll up
	if pos/80 >= 25 {
		copy(crt[:], crt[80:25*80])
		pos -= 80
		s := crt[pos : 25*80]
		for i := range s {
			// 在mac下开启qemu的-M accel=hvf,在滚屏的时候会出现`failed to decode instruction f 7f`
			// 猜测是memclrNoHeapPointer造成的，具体原因未知
			if false {
			}
			s[i] = 0
		}
	}
	c.SetPos(pos)
	crt[pos] = ' ' | 0x0700
}