Tuesday, 11 December 2007

ARM Linux Kernel Boot Requirements

Essentially, the boot loader should provide (as a minimum) the following:

1. Setup and initialise the RAM.
2. Initialise one serial port.
3. Detect the machine type.
4. Setup the kernel tagged list.
5. Call the kernel image.

For more information, refer the following link :

http://www.arm.linux.org.uk/developer/booting.php

Sunday, 18 November 2007

Debugging a Kernel object (ARM + linux)


1. Attach to the target and stop/break.

2. Load vmlinux (the statically linked executable file that contains the Linux kernel).

data.load.elf

A:CC jayant_amber......squashfsvmlinux /strippart 3. /nocode /noclear

3. Now, display the loaded modules (Linux > Display Modules).

4. Now from the TASK.MODule table, note down the .text sections start address (the red-circled address).



5. Well, you got it, we are now gonna use all the ELF info we can extract from the kernel object. Lets use the arm utilities to help us out. So, just do arm_v5t_le-readelf -a samdrv.ko > dump.dump.


6. Find the size of the .data section entry in the Sections Headers part from the dumped file.

7. Lets now calculate the address to relocate the .data section to. Subtract the size of the .data section from the magic number of the kernel object we wanna debug.

0xBF1BC920 0x3FD0 = 0xBF1B8950

8. Now load the kernel object, and use the following relocation code as well.

data.load.elf A:CCjayant_amber......Libsamdrv.ko /strippart 3. /gnu /nocode /noclear

/reloc .text at 0xBF044000 /reloc .rodata after .text /reloc .data at 0xBF1B8950

/reloc .bss after .data

9. Congratulations, you can now step through the kernel object and debug it.


Wednesday, 14 November 2007

Pull-ups vs Pull-downs

As the name suggests, pulling anything up seems way better than the not-so-encouraging downward tug :)...
But seriously speaking, actually as serious as I can get, I always tend to forget all that I studied in college (from the math to the digital circuits...). But the most basic concept I come across everyday is a Pull-up resistor (register as per the Koreans' :D, I mean they tend to pronounce it like that, and its kinda taken its toll over me toooo :)) ). Well, statistically speaking, verbally I come across a pull-down resistor, but it turns out, in the real world, its the pull-up counterpart which scores...

Pull-down resistors : Used to hold the input to a zero(low) value when no other component is driving the input.

Pull-up resistors : Used to ensure that the inputs to a logical system settle at expected logical levels if external devices are disconnected. They are also used at the interface between to logical systems (which might be different from each other) which might be operating at different supply voltages.

In TTL logical systems, the un-connected inputs are inherently left floating, and as such requiring a much lower pull-down resistance value to force the input low. But this results in higher current consumption. For that reason, CHIN-UPs :D are preferred when you encounter a TTL circuit :)...