Robert P. J. Day | 1 Jan 2010 20:59
Picon
Gravatar

Re: Location of source file

On Thu, 31 Dec 2009, Pei Lin wrote:

> 2009/12/27 sky knight <sky_knight02 <at> yahoo.com>
> >
> > Hi guys,
> > Can someone point me to right source files where the kernel loads initrd to memory.
> i just think that's the bootloader's work as GRUB stage 2.
> Check the implementation about the command "initrd" in the GRUB.

  you might also be thinking of the kernel source file
init/initramfs.c, the routine populate_rootfs(), where the early
kernel processing assumes that the initrd image is defined by the two
addresses initrd_start and initrd_end.

  if you look at that function, you'll see right near the top where a
call is made to unpack_to_rootfs() to extract the initrd image.

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

--
(Continue reading)

Pavan Kandepet | 1 Jan 2010 22:34
Picon

Embedded Linux development

Hello,
     I want to get involved and eventually get a job doing embedded
     Linux development. I had a couple of questions for folks who do
     this and could give me some advice. I am specifically interested
     in device driver development and embedded networking.

     I am competent in userland Linux programming and have done
     plenty of kernel compilations etc... I am also an electrical engineer
     and don't have problems reading processor or device manuals etc...

     I know I could get a development board and start working right away,
     but is there any specific development board that you folks would
     recommend which offers great Linux support? I should be able read and
     understand how most of the drivers and networking code work. ( I am
     interested in ARM processor boards). I want to tweak drivers and play
     around.

     Is there any way I could find out what new open source device drivers are
     being developed so that I could contribute? This would be a great place to
     start.

     If there are any embedded Linux developers on this mailing list, how did
     you get started? Any advice is greatly appreciated, thanks and have a great
     new year.
Pavan

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ
(Continue reading)

Shawn | 2 Jan 2010 14:10
Picon

question about __v annotation

hello guys,
 I got a newbie confused when I was looking into the source code of s3c2440's RTC driver.I dont know what is __v excatly means.anyone can tell?thanks anyway!

#define readb(c) ({ __u8  __v = __raw_readb(__mem_pci(c)); __v; })

--
GNU powered it...
GPL protect it...
God blessing it...

regards
HFG--Shawn the R0ck

Mohamed Thalib,,, | 2 Jan 2010 15:21
Picon

Writing to parallel port register

Hi,

I am trying parallel port module in the LDD3 book, I have soldered the 
circuit as said in the book and test it with userspace application, the 
circuit is working fine so no hardware side problem.

But when I try to wirte in parllel port register at address 0x378 it is not 
toggling the leds as given in the ldd book. Im not using the same ldd 
example. modified it to be simple. code is below.

// requesting the region in the module init section

	if(!request_region(base, 8, "par")) {
		printk(KERN_INFO "par: err while request_region()\n");
		return -ENODEV;
	}

// in the open callback func I am trying to toggle the leds

int par_open(struct inode *node, struct file *fp)
{
	static int tog = 0;
	static unsigned char data = 0;
	unsigned long port = base + (par_minor&0x0f);

	printk(KERN_INFO "par: device opened, tog = %d, data = %x\n", 
tog,data);

	if (tog) {
		outb(data, port);
		wmb();
	} else {
		outb(data, port);
		wmb();
	}

	tog ^= 1;
	data ^= 0xff;

	return 0;
}

Any idea where I really did mistake.

Regards,
Mohamed Thalib H

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Manish Katiyar | 3 Jan 2010 04:50
Picon
Gravatar

Re: question about __v annotation

On Sat, Jan 2, 2010 at 6:40 PM, Shawn <citypw <at> gmail.com> wrote:
> hello guys,
>  I got a newbie confused when I was looking into the source code of
> s3c2440's RTC driver.I dont know what is __v excatly means
A local variable name.
..anyone can
> tell?thanks anyway!
>
> #define readb(c) ({ __u8  __v = __raw_readb(__mem_pci(c)); __v; })
>
> --
> GNU powered it...
> GPL protect it...
> God blessing it...
>
> regards
> HFG--Shawn the R0ck
>

--

-- 
Thanks -
Manish
==================================
[$\*.^ -- I miss being one of them
==================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Tadeusz Struk | 3 Jan 2010 08:56
Picon

Re: question about __v annotation


Shawn wrote:
> hello guys,
>  I got a newbie confused when I was looking into the source code of
> s3c2440's RTC driver.I dont know what is __v excatly means.anyone can
> tell?thanks anyway!
> 
> #define readb(c) ({ __u8  __v = __raw_readb(__mem_pci(c)); __v; })
> 
> -- 
> GNU powered it...
> GPL protect it...
> God blessing it...
> 
> regards
> HFG--Shawn the R0ck

Hi,
__v is a variable name.
If you convert this macro to a function it would look something like:

uint8_t f(uint8_t *addr)
{
	uint8_t __v = 0;
	__v = _raw_readb(__mem_pci(addr));
	return __v;
}

Regards
T.
Ryan Wang | 3 Jan 2010 10:09
Picon

Re: question about __v annotation

2010/1/3 Ryan Wang <openspace.wang <at> gmail.com>:
> 2010/1/2 Shawn <citypw <at> gmail.com>:
>> hello guys,
>>  I got a newbie confused when I was looking into the source code of
>> s3c2440's RTC driver.I dont know what is __v excatly means.anyone can
>> tell?thanks anyway!
>>
>> #define readb(c) ({ __u8  __v = __raw_readb(__mem_pci(c)); __v; })
>>
>> --
>> GNU powered it...
>> GPL protect it...
>> God blessing it...
>>
>> regards
>> HFG--Shawn the R0ck
>>
>
> notice "{ ... }"
> It's code block, and __v is its last value
> when you use readb link
>        somevar = readb(someport)
> then __v is return to set somevar
>
Oh, sorry
I've made a mistake

{} is a compound statement, () quotes it, and then you get one expression.
And the value of the expression is the last value of the compound statement.
so you can use readb like this:
         alm_en = readb(base + S3C2410_RTCALM);
Here, read(..) is one expression, and you should add ";" after it.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

rahul dev | 3 Jan 2010 08:55
Picon
Favicon

significance of BUF_CLEAN list

Guys,

   In function __refile_buffer() (linux 2.4.21-50), what is the significance of moving a buffer to
BUF_CLEAN list.

I don't see traversing BUF_CLEAN list anywhere in the code. So, why do we need to move the buffer to clean
list. In case if dispose == BUF_CLEAN, just removing the buffer from dirty/locked list should be sufficient.

What do you think? 

thanks,
rahul

      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Microbit_Ubuntu | 3 Jan 2010 14:58
Picon

Re: Embedded Linux development

Hi Pavan,

On Fri, 2010-01-01 at 13:34 -0800, Pavan Kandepet wrote:
> Hello,
>      I want to get involved and eventually get a job doing embedded
>      Linux development. I had a couple of questions for folks who do
>      this and could give me some advice. I am specifically interested
>      in device driver development and embedded networking.
> 
>      I am competent in userland Linux programming and have done
>      plenty of kernel compilations etc... I am also an electrical engineer
>      and don't have problems reading processor or device manuals etc...
> 
>      I know I could get a development board and start working right away,
>      but is there any specific development board that you folks would
>      recommend which offers great Linux support? I should be able read and
>      understand how most of the drivers and networking code work. ( I am
>      interested in ARM processor boards). I want to tweak drivers and play
>      around.
> 
>      Is there any way I could find out what new open source device drivers are
>      being developed so that I could contribute? This would be a great place to
>      start.
> 
>      If there are any embedded Linux developers on this mailing list, how did
>      you get started? Any advice is greatly appreciated, thanks and have a great
>      new year.
> Pavan
> 
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
> 

>      If there are any embedded Linux developers on this mailing list, how did
>      you get started? 

I've been into embedded for years, but only recently did I notice nowadays Embedded Linux is a must (as an
embedded engineer).
Entry level made my head spin, but after some research I found that Olimex had a particularly good deal
when it comes to stepping into the ARM Linux world.

I guess it depends on one last criteria - whether you want full graphics (ie. LCD & touch screen etc), or are
happy with
a terminal interface. I chose the latter, as I thought it's already complex enough without graphics, let alone....
(I'm planning to expand to fuller graphics at some stage when I'm more comfortable)

So I settled on the SAM9-L9260 Olimex board :
http://olimex.com/dev/index.html

You can see the full heads up at the URL under SAM9-L9260. I found it a very good deal, considering the low
price tag.
The board comes turnkey "preflashed" for the first giant step.. :-)

It uses an Atmel SAM9 (ARM926ej-S, v5TEJ)  <at>  180/200 MHz. It's got 512 MB of NandFlash, 64 MB SDRAM, USB
host/device, Ether 100M, SD/MMC/SDIO, full RS232 (+2 extra ports), standard JTAG.. etc
I've already crossed many hurdles and would be happy to pool resources or guide you if you get stuck on entry etc.

For tools, I ended up with Buildroot (2009.08) so I can completely
customise everything incl my rootfs. I'm using (ARM)GCC 4.3.3 on Ubuntu
9.10 host wise.

While still learning, I've updated quite a few things, plus struggled
through various issues, as I found Linux help in the embedded world
seems to be a lot more scarce than on PCs.

I've patched the latest U-boot version to run on that L9260 board (the
PHY support is missing), latest stable kernel so you can use menuconfig
properly etc.

The result so far is that my embedded board boots in about ~18 secs with
a modest rootfs (JFFS2). If you're curious about that, I'm attaching a
log at end of this post of my bootlog on SAM9-L9260.

If you're interested in this, I can elaborate further - as I too am
ultimately interested in becoming proficient writing kernel space
drivers/modules.
Finally, since a while, I've quite taken to Eclipse/Galileo to do
user/kernel cross development and source level debugging. That was a day
and a half on its own all right... especially to get module stuff going
(getting kgdb to work on ARM9 iow source level remote target debug, but
a couple of helpful members here clued me in :-)

Wrt. open source development, as a "test" I'm planning to add Linux
support for SDW-820 SDIO WiFi card. About a year ago I wrote my own
'from scratch' ARM based driver for it, but I don't know yet how to deal
with the open source issue vs. NDA I had to sign with Sigtec to get some
example partial driver WINCE code. I reverse engineered how to talk to
the IPN2128 Inprocomm MAC chipset. It took me over a month to figure out
how that beastie is driven (it's very complicated) , but I have a
completely functional WiFi driver.
That's what's going on here wrt. planned driver development.

** Here's the log to give you idea of L9260 board :

reboot
# The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system reboot
Restarting system.
RomBOOT
>AT91Bootstrap loading from 0x8400...

U-Boot 2009.03 (Aug 14 2009 - 01:32:23)
DRAM:  64 MB
NAND:  512 MiB
DataFlash:AT45DB161
Nb pages:   4096
Page Size:    528
Size= 2162688 bytes
Logical address: 0xD0000000
Area 0:	D0000000 to D00041FF (RO) Bootstrap
Area 1:	D0004200 to D00083FF      Environment
Area 2:	D0008400 to D0041FFF (RO) U-Boot
Area 3:	D0042000 to D0251FFF      Kernel
Area 4:	D0252000 to D020FFFF      FS
In:    serial
Out:   serial
Err:   serial
Net:   macb0
macb0: PHY present at 1
macb0: link up, 100Mbps full-duplex (lpa: 0x45e1)
Hit any key to stop autoboot:  3  2  1  0 
## Booting kernel from Legacy Image at 22200000 ...
   Image Name:   Linux-2.6.29.4
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1622792 Bytes =  1.5 MB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK
Starting kernel
...
Uncompressing
Linux..........................................................................................................
done, booting the kernel.
Linux version 2.6.29.4 (kris <at> Ubuntu) (gcc version 4.3.3 (GCC) ) #14
PREEMPT Sun Aug 23 03:00:55 EST 2009
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Olimex SAM9-L9260
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 180 MHz, master 90 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2
AT91: 96 gpio irqs in 3 banks
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [ttyS0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61444KB available (3056K code, 264K data, 92K init)
Calibrating delay loop... 89.70 BogoMIPS (lpj=448512)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 520 bytes
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
audit: initializing netlink socket (disabled)
type=2000 audit(0.480:1): initialized
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 120
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
loop: module loaded
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffc4000 irq 21 (4a:72:ac:3e:e1:fa)
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:01, irq=-1)
Driver 'sd' needs updating - please use bus_type methods
NAND device: Manufacturer ID: 0xec, Chip ID: 0xdc (Samsung NAND 512MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 384 at 0x000003000000
Creating 2 MTD partitions on "NAND 512MiB 3,3V 8-bit":
0x000000000000-0x000000400000 : "Bootloader Area"
0x000000400000-0x000020000000 : "User Area"
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: AT91 OHCI
usb usb1: Manufacturer: Linux 2.6.29.4 ohci_hcd
usb usb1: SerialNumber: at91
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
Registered led device: led_stat
Registered led device: led_pwr
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17
NET: Registered protocol family 15
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
VFS: Mounted root (jffs2 filesystem) on device 31:1.
Freeing init memory: 92K
init started: BusyBox v1.14.3 (2010-01-03 02:04:55 EST)
Populating /dev using udev: done
Starting portmap: done
Initializing random number generator...done.
Starting network...
udhcpc (v1.14.3) started
Sending discover...
Sending select for 192.168.1.4...
eth0: link up (100/Full)
Lease of 192.168.1.4 obtained, lease time 86400
deleting routers
route: SIOCDELRT: No such process
adding dns 192.168.1.1
Starting sshd: OK

Welcome to Buildroot
L9260 login: root
# 

********************************************

HTH !

--

-- 
Best regards,
Kris

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Anand Arumugam | 3 Jan 2010 17:49
Picon

Re: question about __v annotation

I think the last __v; inside the macro is to avoid compiler warning or error that the unsigned 8-bit variable __v is not being used inside the scope defined by the macro.

On Sat, Jan 2, 2010 at 8:10 AM, Shawn <citypw <at> gmail.com> wrote:
hello guys,
 I got a newbie confused when I was looking into the source code of s3c2440's RTC driver.I dont know what is __v excatly means.anyone can tell?thanks anyway!

#define readb(c) ({ __u8  __v = __raw_readb(__mem_pci(c)); __v; })

--
GNU powered it...
GPL protect it...
God blessing it...

regards
HFG--Shawn the R0ck


Gmane