Kernel Source Code

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
GeniusCobyWalker
Member
Member
Posts: 65
Joined: Mon Jan 12, 2009 4:17 pm

Kernel Source Code

Post by GeniusCobyWalker »

If anyone would like to post their Kernel source as an example to help others post it here. :wink:
Looking for example source here it is. =D>

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"
Last edited by GeniusCobyWalker on Tue Jan 20, 2009 3:14 pm, edited 2 times in total.
Full Knowledge in:
GML, Ti-Basic, Zilog Z80 Assembly, SX28 Assembly and Blender
Experience in:
C++,OpenGl,NDS C++,Dark Basic,Dark Basic Pro,Dark Gdk and PSP Coding
Using:
Ubuntu ,GEdit ,NASM ,GCC ,LD ,Bochs
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: I am new and need help please.

Post by Love4Boobies »

GeniusCobyWalker wrote: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.
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?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Re: I am new and need help please.

Post by Alboin »

And why the heck would you add a ~ after the extensions?
Those generally signify that the file is a backup.
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: I am new and need help please.

Post 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... :?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
gzaloprgm
Member
Member
Posts: 141
Joined: Sun Sep 23, 2007 4:53 pm
Location: Buenos Aires, Argentina
Contact:

Re: I am new and need help please.

Post 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
Visit https://gzalo.com : my web site with electronic circuits, articles, schematics, pcb, calculators, and other things related to electronics.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: I am new and need help please.

Post 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).
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Kernel Source Code

Post by Troy Martin »

In other words: This "kernel" is crap.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Kernel Source Code

Post 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.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Kernel Source Code

Post 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 :lol: ...
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Re: Kernel Source Code

Post by piranha »

If anyone would like to post their Kernel source as an example to help others post it here. :wink:
Looking for example source here it is. =D>

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
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Kernel Source Code

Post 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 :)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Kernel Source Code

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Post Reply