Hi guys!
I've found a book in my school's library teaching the C language , so I've started reading and discovered many new things .To practice , I've took a look at the C bare bones tuto , and wrote a kernel that does 2 things
Clear the screen , Print a hello message in protected mode
it's just to practice . it's loaded by grub .
so i was thinking if someone of you may take a look at my source code and tell me some thins about my programming/writing manner , some advices ....
so the source and the an boot image are included in the attachment .
Thanks guys
Cygwin : error: no 8-bit type
Re: Cygwin : error: no 8-bit type
- Attachments
-
- ngos.rar
- (56.77 KiB) Downloaded 91 times
The WORLD is RELATIVE .
http://en.wikipedia.org/wiki/Theory_of_relativity
http://en.wikipedia.org/wiki/Theory_of_relativity
Re: Cygwin : error: no 8-bit type
- In C/C++ it is common practice to start function names with lower case (myFunction()). Only structs and - in C++ - classes are started in uppercase (struct MyStruct, MyClass).
- Very nice that you documented your functions with source comments!
- Use a .h file to declare the functions, and a .c file to define them. Place the documentation for each function right before its declaration instead of bundling the docs at the top of the file.
- Avoid variables that are initialized to some constant value and then only used once. The compiler probably optimizes away the actual creation of the variable on the stack, but it introduces a variable name that's completely irrelevant (msgOEM, udlOEM).
- Your indenting is good. But you used three-space indent, four-space indent, and tab indent all mixed together. Set your editing environment to using one indenting style consistently. There's some holy war around the subject, but in the end four-space indent and tab-indent are the only two suitable alternatives, and I strongly favor the four-space indent.
- At various points in the source, you use "magic numbers". (Any numerical constant not -1, 0, or 1.) It's good practice to declare them as int const (or preprocessor token) at one central place, including a quick one-line comment as to what they mean. Especially when those numbers are used in more than one place (e.g. VIDEO_BASE instead of 0xb8000).
- If your orthography lets something to be desired, don't hesitate to use a spell checker on something like Readme.txt.
Every good solution is obvious once you've found it.
Re: Cygwin : error: no 8-bit type
Ok Thanks solar
i'll keep that in mind
i'll keep that in mind
The WORLD is RELATIVE .
http://en.wikipedia.org/wiki/Theory_of_relativity
http://en.wikipedia.org/wiki/Theory_of_relativity