From: H. Peter Anvin Date: Wed, 3 Jun 2009 02:56:27 +0000 (-0700) Subject: core/hello.c: better demo on how to do putchar() X-Git-Tag: syslinux-4.00-pre1~2^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d19a7c6a6989f19c4f82212a9a7b654bdf289739;p=platform%2Fupstream%2Fsyslinux.git core/hello.c: better demo on how to do putchar() Better illustrate how putchar() should be implemented... Signed-off-by: H. Peter Anvin --- diff --git a/core/hello.c b/core/hello.c index eb0069f..a4fff7a 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); }