Page 1 of 1
Kernel Source Code
Posted: Mon Jan 19, 2009 10:08 pm
by GeniusCobyWalker
If anyone would like to post their Kernel source as an example to help others post it here.
Looking for example source here it is.
Origonal:
Heres my OS that i'm working on:
http://www.mediafire.com/?my0d80jcg31
(Extremely Basic)
Look over it and see if this helps you at all.
Sorry clicked "New topic" not "Post reply"
Re: I am new and need help please.
Posted: Mon Jan 19, 2009 10:17 pm
by Love4Boobies
Trust me, you will need none of that. It's just a bunch of tutorial copy & pastes, empty files and some files unrelated to the project. And why the heck would you add a ~ after the extensions?
Re: I am new and need help please.
Posted: Mon Jan 19, 2009 10:21 pm
by Alboin
And why the heck would you add a ~ after the extensions?
Those generally signify that the file is a backup.
Re: I am new and need help please.
Posted: Mon Jan 19, 2009 10:23 pm
by Love4Boobies
Ah, ok. Still, I can't see the reason for including those in the archive. Also, check the contents of your files... You will find something a bit... odd...
Re: I am new and need help please.
Posted: Mon Jan 19, 2009 10:39 pm
by gzaloprgm
What's the odd thing(s)?
I can
only spot these:
- Image size is 109 KB instead of 'normal' 1474560 bytes.
- 'Blank Padding' file isn't filled with zeroes
- Ascii.c contains a keymap
- Keymap is not used anywhere
- No COPYING file (he's using GPL Grub)
- Backup of backup (.*~~) seems useless
- Grub not actually installed
- Code is stolen from other tutorials
Am I missing something?
Cheers,
Gonzalo
Re: I am new and need help please.
Posted: Tue Jan 20, 2009 4:40 pm
by Love4Boobies
gzaloprgm wrote:- Image size is 109 KB instead of 'normal' 1474560 bytes.
That's actually a good thing.
gzaloprgm wrote:Am I missing something?
- The use of semicolons after "}"s.
- The lack of optimization in loops.
- The fact that kmain() actually returns.
- Why is the directory full of makefiles?
- Don't even get me started on that batch file (which isn't very convinent to run either, since it has a backup thingamajig after the normal extension). "cat" isn't a Windows program... Besides, this is a bastardized version of the makefile(s). And why is there a copy of it called "build.sh~"?
- The presence of bochsrc.txt (and its backup).
- The fact that loader.s~ and Text.c~ are empty.
- Finally, I see no reason for including 2 files which read the text "blankpadding" 100 times (didn't actually count).
Re: Kernel Source Code
Posted: Tue Jan 20, 2009 5:07 pm
by Troy Martin
In other words: This "kernel" is crap.
Re: Kernel Source Code
Posted: Tue Jan 20, 2009 5:37 pm
by neon
The fact that kmain() actually returns.
There is nothing wrong if the kernel entry point returns just so long as there is a place for it to return to.
Re: Kernel Source Code
Posted: Tue Jan 20, 2009 5:46 pm
by Love4Boobies
Technically, you're right, but it's considered bad practice (esp. if there's more people working on one kernel, since it may be that someone else wrote the part with the Multiboot header). As I already pointed out, "loader.S~" (and friends) is(/are) empty so I guess we'll never know if it's actually a bug
...
Re: Kernel Source Code
Posted: Tue Jan 20, 2009 5:50 pm
by piranha
If anyone would like to post their Kernel source as an example to help others post it here.
Looking for example source here it is.
Origonal:
Heres my OS that i'm working on:
http://www.mediafire.com/?my0d80jcg31
(Extremely Basic)
Look over it and see if this helps you at all.
Well, firstly, we have an OSdev projects page. No need for a topic. Plus, if you want to use all of my code, you may, but don't call it your own. btw, the only reason that I'm saying that you can do it is because I'm bound by the terms of my license file, and the tutorials that I borrowed some code from.
Plus, you clicked the wrong button? And you didn't notice when it wanted a topic that something was askew?
-JL
Re: Kernel Source Code
Posted: Tue Jan 20, 2009 6:09 pm
by neon
Technically, you're right, but it's considered bad practice
It is coinsidered bad practice by who? If the OS industry, please share any links if you have any
Re: Kernel Source Code
Posted: Tue Jan 20, 2009 6:19 pm
by Love4Boobies
I remember reading this in MIT's
6.828 Operating System Engineering course, some years ago. Most probably in the source code of their example OS (i.e. comment), I can't remember and I'm too lazy to check.