WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Question on the microcore Linux kernel  (Read 19183 times)

Offline lid

  • Jr. Member
  • **
  • Posts: 62
Question on the microcore Linux kernel
« on: November 11, 2012, 12:37:36 PM »
Hi,

I was able to pxeboot the microcore using vmlinuz as kernel and core.gz as initrd.
As far as I can see, the kernel is

tc@box:~$ uname -a
Linux box 3.0.21-tinycore #3021 SMP Sat Feb 18 11:54:11 EET 2012 i686 GNU/Linux
tc@box:~$

The questions are:

1. Is this the stock Linux kernel 3.0? Or has it been modified?
2. If it has been modified, where can I find the diff?

Thanks.

David

Offline genec

  • Full Member
  • ***
  • Posts: 240
Re: Question on the microcore Linux kernel
« Reply #1 on: November 11, 2012, 12:43:21 PM »
1. Is this the stock Linux kernel 3.0? Or has it been modified?
2. If it has been modified, where can I find the diff?

1) Yes.  2) with the other source files.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704

Offline lid

  • Jr. Member
  • **
  • Posts: 62
Re: Question on the microcore Linux kernel
« Reply #3 on: November 12, 2012, 10:51:37 AM »
Hi lid
Check here:
http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/src/kernel/

I got the linux-3.0.21-patched.txz. How do I find out about the diff from the stock kernel? Should I just run diff against stock 3.0.21? Or is there any document that describes the changes.


Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Question on the microcore Linux kernel
« Reply #4 on: November 12, 2012, 11:12:03 AM »
See the patches subdir there ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline lid

  • Jr. Member
  • **
  • Posts: 62
Re: Question on the microcore Linux kernel
« Reply #5 on: November 12, 2012, 11:18:09 PM »
See the patches subdir there ;)

OK, got it.

I am trying to understand the magic why microcore can be booted up entirely in RAM. My kernel knowledge is limited. It seems to me that the tmpfs-root.patch is the key. This patch lets the ramfs to be used as root fs. Is this correct?

What I still dont' understand is how kernel knows to use ramfs on boot? In my pxeboot, the bootloader only has the following line:

   APPEND initrd=tinycore/core.gz

It's not obvious to me that how the kernel determined to boot everything into RAM.
Can someone give me more pointers or explain a little bit more?

David


Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Question on the microcore Linux kernel
« Reply #6 on: November 12, 2012, 11:30:27 PM »
initrd stands for initial ramdisk.
Linux boots into RAM.
With most distros, the initrd mounts a new root file system and then switches to it.
Core skips this step, and continues to run in RAM.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11050
Re: Question on the microcore Linux kernel
« Reply #7 on: November 13, 2012, 02:57:42 AM »
For background, see Core Concepts, and the Distrowatch interview from a couple years back.

http://distrowatch.com/weekly.php?issue=20090323
The only barriers that can stop you are the ones you create yourself.

Offline lid

  • Jr. Member
  • **
  • Posts: 62
Re: Question on the microcore Linux kernel
« Reply #8 on: November 13, 2012, 10:12:02 AM »
initrd stands for initial ramdisk.
Linux boots into RAM.
With most distros, the initrd mounts a new root file system and then switches to it.
Core skips this step, and continues to run in RAM.

I want to play with it. Should I use config-3.0.21-tinycore as .config to recompile the kernel as 32 bit? If so, should I copy config-3.0.21-tinycore to .config and do a make oldconfig?

Thanks.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11050
Re: Question on the microcore Linux kernel
« Reply #9 on: November 13, 2012, 10:16:23 AM »
Yes, that works.
The only barriers that can stop you are the ones you create yourself.

Offline lid

  • Jr. Member
  • **
  • Posts: 62
Re: Question on the microcore Linux kernel
« Reply #10 on: November 13, 2012, 12:47:21 PM »
initrd stands for initial ramdisk.
Linux boots into RAM.
With most distros, the initrd mounts a new root file system and then switches to it.
Core skips this step, and continues to run in RAM.

A follow up question: Can a stock kernel also bypass mounting the root fs and directly boot into ram? Can this be done just by using kernel boot options like root=/dev/ram0?


Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Question on the microcore Linux kernel
« Reply #11 on: November 13, 2012, 12:58:27 PM »
Without telling the bootloader to load the initrd. there is no RAM filesystem to mount.
There is nothing particularly unique about Core's kernel.

Offline lid

  • Jr. Member
  • **
  • Posts: 62
Re: Question on the microcore Linux kernel
« Reply #12 on: November 13, 2012, 01:56:53 PM »
Without telling the bootloader to load the initrd. there is no RAM filesystem to mount.
There is nothing particularly unique about Core's kernel.

I mean how about "initrd=core.gz root=/dev/ram0". Will this work with a stock kernel to boot into ram?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Question on the microcore Linux kernel
« Reply #13 on: November 13, 2012, 02:31:21 PM »
Go back and reread reply #6.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Question on the microcore Linux kernel
« Reply #14 on: November 14, 2012, 12:40:13 AM »
The links under chapter "initramfs" here:
http://www.landley.net/writing/
should pretty much cover the whole subject.

To me it looks like the patch is replacing ramfs with tmpfs, though from what I had read I had always understood that tmpfs could be enabled without a patch, so I am not really sure about that.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)