summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/tiny/io.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-02-14 13:23:51 +0100
committerOndřej Surý <ondrej@sury.org>2011-02-14 13:23:51 +0100
commit758ff64c69e34965f8af5b2d6ffd65e8d7ab2150 (patch)
tree6d6b34f8c678862fe9b56c945a7b63f68502c245 /src/pkg/runtime/tiny/io.go
parent3e45412327a2654a77944249962b3652e6142299 (diff)
downloadgolang-upstream/2011-02-01.1.tar.gz
Imported Upstream version 2011-02-01.1upstream/2011-02-01.1
Diffstat (limited to 'src/pkg/runtime/tiny/io.go')
-rw-r--r--src/pkg/runtime/tiny/io.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/pkg/runtime/tiny/io.go b/src/pkg/runtime/tiny/io.go
deleted file mode 100644
index f30e68889..000000000
--- a/src/pkg/runtime/tiny/io.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Simple CGA screen output
-
-package runtime
-
-import "unsafe"
-
-var crt *[25 * 80]uint16
-var pos int
-
-func putc(c int) {
- const (
- port = 0x3d4
- color = 0x0700 // white on black
- )
-
- if crt == nil {
- // init on demand in case printf is called before
- // initialization runs.
- var mem uintptr = 0xb8000
- crt = (*[25 * 80]uint16)(unsafe.Pointer(mem))
- pos = 0
- for i := range crt[0:] {
- crt[i] = 0
- }
- }
-
- switch c {
- case '\n':
- pos += 80 - pos%80
- default:
- crt[pos] = uint16(c&0xff | color)
- pos++
- }
-
- if pos/80 >= 24 {
- copy(crt[0:], crt[80:])
- pos -= 80
- for i := 0; i < 80; i++ {
- crt[24*80+i] = 0
- }
- }
- crt[pos] = ' ' | color
-}
-
-func write(fd int32, b []byte) {
- for _, c := range b {
- putc(int(c))
- }
-}