aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-06-02 19:56:27 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-06-02 19:56:27 -0700
commitd19a7c6a6989f19c4f82212a9a7b654bdf289739 (patch)
tree7fe1ce39598e5a4a562749037aa334881b4a36ca /core
parent390ab32864ad3fcbe58096a2e2fdcf6465f173fe (diff)
downloadsyslinux-d19a7c6a6989f19c4f82212a9a7b654bdf289739.tar.gz
syslinux-d19a7c6a6989f19c4f82212a9a7b654bdf289739.tar.xz
syslinux-d19a7c6a6989f19c4f82212a9a7b654bdf289739.zip
core/hello.c: better demo on how to do putchar()
Better illustrate how putchar() should be implemented... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core')
-rw-r--r--core/hello.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/hello.c b/core/hello.c
index eb0069f0..a4fff7ad 100644
--- a/core/hello.c
+++ b/core/hello.c
@@ -4,13 +4,13 @@
void myputchar(int c)
{
static com32sys_t ireg;
- static uint16_t *vram = 0xb8000;
+
+ if (c == '\n')
+ myputchar('\r');
ireg.eax.b[1] = 0x02;
ireg.edx.b[0] = c;
__intcall(0x21, &ireg, NULL);
-
- *vram++ = c + 0x1f00;
}
void myputs(const char *str)
@@ -21,7 +21,7 @@ void myputs(const char *str)
void hello(void)
{
- static char hello_str[] = "Hello, World! (hello.c)\r\n";
+ static char hello_str[] = "Hello, World! (hello.c)\n";
myputs(hello_str);
}