I am writing a new kernel using C. Can anyone tell me how to insert line breaks? I have been using "\n" but it always showed up as wierd characters on the screen.
Oh yeah, I heard somewhere that you could use ANSI escape sequences... How do you type the escape character in WinXP??
line break
Re:line break
Everything is up to you...you have to define and write your printf() function which handles line breaks ('\n') and other functions...
Re:line break
You're probably part-way there if you've got something to show up on screen. You should be keeping track of the row and column where the next character is to be outputted; when you see a '\n' in the string, set the row and column to point to the start of the next line.
Regarding escape sequences: again, they'll only be supported if you write code to handle them. You don't need to type the escape character (in fact, you can't); use the '\x1B' sequence.
Regarding escape sequences: again, they'll only be supported if you write code to handle them. You don't need to type the escape character (in fact, you can't); use the '\x1B' sequence.
Re:line break
Hello!
The best methode to see how escape sequences lokk like is to open your (compiled) kernel-file in a hex editor. There you can see how the compiler translated the escape sequences. Then you can write a print-function that takes care of these ascii-codes and threat them right (line-break, tab-stop, PC-Speaker-Beep, ...).
Start with a simple print-function that only can print strings. Later you can write a printf-function that although converts integers to string.
The best methode to see how escape sequences lokk like is to open your (compiled) kernel-file in a hex editor. There you can see how the compiler translated the escape sequences. Then you can write a print-function that takes care of these ascii-codes and threat them right (line-break, tab-stop, PC-Speaker-Beep, ...).
Start with a simple print-function that only can print strings. Later you can write a printf-function that although converts integers to string.