Can I change PCIe TLP's Tag value?

2024-07-08 Thread 김찬

Hello all,
We are doing a test by modiying a simple PCIe device driver to do memory write 
and read.
Write and read from to the device's PCIe core's internal register is ok but 
when we do memory write and read for the device's internal memory, the writes 
are ok (we can observer the result using jtag debugger) but the MemRd causes 
error (we checked using PCIe test equipment called VIAVI). The equipment 
support person said the error came out because the Tag value of the MemRd TLP 
is the same as the MemWr TLP's. So is there a method by which I can change the 
Tag value of the TLP?
Thank you.
Chan Kim


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Translation fault while using mmu-600 (only when dma alloc is done during application on the fly)

2024-03-22 Thread 김찬

Hello all,These several days we are having a difficulty in our linux 
device driver development.

case A ) Here we allocate the dma buffer for our accelerator device during the 
device driver(a platform driver) initialization and we don't have problem. That 
is, we use kmalloc + dma_map_single during the driver initialization and after 
the boot is complete, we run the application which uses the driver. During the 
application, the driver just calls dma_sync_single_for_device function and our 
accelerator device actually access the dma buffer with no problem. (no 
translation fault).

case B) Here we allocate the dma buffer for our accelerator device while the 
application runs after the boot (the buffer is not allocated during the drive 
initialization). While the application runs, the driver does the kmalloc + 
dma_map_single + dma_sync_single_for_device and then when then device accesses 
the dma buffer, we see translation fault. By printing the SMMU event data, we 
know it's for data read access, and the class is 'b10 which is 'Input address 
caused fault'. and it is from the first stage (S2=0).

We know that the SMMU reads STE, CD and 3 entries of translation table. (we use 
48bit address). Can we know in what stage of this 5 stages the fault arose? By 
the way the io virtual address starts with 0x7~ (48bit) in both cases. 
Could anyone suggest us what information to look into now?

Thank you,
Best regards,Chan Kim

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


How can I make dma_alloc to use the device's reserved memory?

2023-11-01 Thread 김찬

Hi kernel experts,

If some memory was reserved for a dma-able device using device tree's 
'reserved-memory' property, if I do dma_alloc_coherent for the device, does it 
allocate memory in that reserved memory? I don't think so because 
dma_alloc_coherent works regardless of wether there is reserved memory for the 
device or not. Then how can I make the kernel reserve the dma memory from that 
reserved memory?

Thank you.
Chan Kim


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


passing FDT(flattened device tree) to kernel during booting

2020-10-23 Thread 김찬
Hello all,
I read here (https://www.kernel.org/doc/Documentation/arm64/booting.txt 
https://www.kernel.org/doc/Documentation/arm64/booting.txt) the device tree 
blob location should be passed to the kernel during arm64 booting through 
x0 register. But I see many .dts files under arch/arm64/boot/dts for many 
commercial boards. Does this mean that 1) we are supposed to use one of these 
files in the bootloader program to setup the device tree and pass it to kernel? 
or 2) we can embed the device tree inside the kernel during kernel building and 
just use it during the boot?
Any help will be appreciated.
Chan Kim
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


RE: I want to sleep while holding a mutex

2015-06-05 Thread 김찬

 Are you trying to use the mutex during a interrupt handler as you can't you
 need something atomic or not able to sleep like a spinlock.
 Nick

I use mutex during FIFO burst write or burst read. I don't want other processes 
to mess up the FIFO access.
spinlock is not for long interval I understand.
Chan


보낸 사람 : nick xerofo...@gmail.com
보낸 날짜 : 2015-06-05 21:34:25 ( +09:00 )
받는 사람 : 김찬 c...@etri.re.kr, kernelnewbies@kernelnewbies.org 
kernelnewbies@kernelnewbies.org
참조 :
제목 : Re: I want to sleep while holding a mutex



On 2015-06-05 08:30 AM, Chan Kim wrote:
 Hello,
 I need to write to and read from a Ethernet chip's FIFO and for that I want 
 to use DMA controller. So I modified an existing driver and made the process 
 to sleep using wait_event_interruptible after triggering DMA transfer and 
 made it woken up by ISR using wake_up_interruptible. My problem is that the 
 original driver was using spinlock to protect the FIFO access. But as all 
 know, while holding spinlock, I should not sleep. So I tried replacing 
 spinlock with mutex. (Because, I might sleep while acquiring the mutex, and 
 after getting the mutex, I'll sleep again after DMA trigger. I get woken up 
 by the ISR, and I'll release the mutex. No problem! I thought. ) But I still 
 get this 'scheduling while atomic BUG'. The question is : I need to go to 
 sleep until DMA completion while holding a lock (for FIFO read and write). 
 Isn't it ok to sleep while holding a mutex?
 Best regards,
 Chan Kim
 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Are you trying to use the mutex during a interrupt handler as you can't you 
need something
atomic or not able to sleep like a spinlock.
Nick
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


RE: device returned IRQ_WAKE_THREAD but no thread function avable error

2015-05-19 Thread 김찬

The reason I received “IRQ 2 device ald_dmac returned IRQ_WAKE_THREAD but no 
thread function available” was that in the interrupt handler, I didn’t return 
IRQ_HANDLED properly.
I guess if I don’t return IRQ_HANDLED, the basic handler interprets it as 
having returned IRQ_WAKE_THREAD and tries to run the thread given by the 
thread_fn argument of the request_threaded_irq function. (which is NULL in my 
case).
So when I made the interrupt handler return IRQ_HANDLED, that message is gone.
Chan Kim

From: kernelnewbies-bounces+ckim=etri.re...@kernelnewbies.org 
[mailto:kernelnewbies-bounces+ckim=etri.re...@kernelnewbies.org] On Behalf Of 
Cha
Sent: Monday, May 18, 2015 6:46 PM
To: kernelnewbies@kernelnewbies.org
Subject: device returned IRQ_WAKE_THREAD but no thread function avable error


In the smsc911x Ethernet chip driver, I'm changing the FIFO write and read to 
DMA write and read.
By the way, this driver uses loopback test during initialization using a simple 
test packet.
I registered the DMA controller irq using request_irq(irq, handler, flags, 
name, dev) which calls request_threaded_irq(irq, handler, NULL, flags, name, 
dev).

The process goes into sleep using wait_event_interruptible() after DMA command 
and I've seen the ISR handler is called by the DMA completion, and during the 
ISR, wake_up_interruptible() is called to wake up the process.

But when the program runs I get this error message below during the first 
interrupt processing.
IRQ 2 device ald_dmac returned IRQ_WAKE_THREAD but no thread function 
available
I don't know why ald_dmac returned IRQ_WAKE_THREAD (because my interrupt 
handler only returns IRQ_HANDLED), and I have a feeling that in this case 
(processing going to sleep and woken up by the ISR), I should use some other 
method to register my interrupt.
Can anybody give me some advice?

Thanks a lot in advance.
Chan Kim


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: two virtual address pointing to same physical address

2014-05-20 Thread 김찬

FYI,
I found out this morning, there is a SRMMU setting with initial page table 
before linux start_kernel starts.
The page table directs 0xc000 to 0x6000.
Chan


보낸 사람 : Chan Kim c...@etri.re.kr
보낸 날짜 : 2014-05-20 22:29:08 ( +09:00 )
받는 사람 : valdis.kletni...@vt.edu valdis.kletni...@vt.edu
참조 : kernelnewbies@kernelnewbies.org kernelnewbies@kernelnewbies.org
제목 : Re: two virtual address pointing to same physical address

Valdis and all,
I understand we cannot access the same physical memory both as cacheable and 
non-cacheable.
and I'm pretty sure they were pointing to the same physical address. (I haven't 
check with mmap yet, I will try later.)
The point I was confused about was the __nocache_fix operation to the address.
Writing a reply email, I remembered that the __nocache_fix conversion to the 
address is used only before MMU setup.
After MMU setup (setting the context table and PGD pointer to the MMU 
register), the __nocache_fix operation to the address is not used.
but __nocache_fix(0xc8000320) is 0xc0540320 and In our system we don't have 
physical memory at 0xc000 ~.
(we have memory at 0x6000 ~ 0x6fff)
seeing the definition of __nocache_fix, the input and ouput is all virtual 
address (VADDR).
This means I can access virtual address 0xc054 (nocache region) through MMU 
to 0x6054.
Maybe before the MMU setup, somewhere at a previous point, the 0xc054 - 
0x6054... virtual-physical conversion may have been setup to the SRMMU. I have 
to check. (in the prom_stage, or very early in the init)
Can anybody give me some light on this?
Thanks,
Chan



보낸 사람 : valdis.kletni...@vt.edu
보낸 날짜 : 2014-05-20 11:31:14 ( +09:00 )
받는 사람 : 김찬
참조 : kernelnewbies@kernelnewbies.org
제목 : Re: two virtual address pointing to same physical address

On Tue, 20 May 2014 00:39:26 -, Chan Kim said:
 But still it's confusing. Can two virtual addresses from the same process
 (in init process, one for nocache pool, the other not) point to the same
 physical address?

I'm not sure what you're trying to say there. In general, the hardware
tags like non-cacheable and write-combining are applied to physical addresses,
not virtual.

And a moment's thought will show that treating the same address (whether it's
virtual or physical) as caching in one place and non-caching in another is just
*asking* for a stale-data bug when the non-caching reference updates data and
the caching reference thinks it's OK to use the non-flushed non-refreshed
cached data.

It's easy enough to test if two addresses from a single process can
point to the same physical address - do something like this:

/* just ensure these two map the same thing at different addresses */
foo = mmap(something,yaddayadda);
bar = mmap(something,yaddayadda);
/* modify via one reference */
*foo = 23;
/* you probably want a barrier call here so gcc doesn't screw you */
/* Now dereference it via the other reference */
printf(And what we read back is %d\n, *bar);

(Making this work is left as an exercise for the student :)

And figuring out why you need a barrier is fundamental to writing bug-free
code that uses shared memory. The file Documentation/memory-barriers.txt
is a good place to start.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


about BTFIXUPSET_.. macros (for sparc, MMU)

2014-04-14 Thread 김찬
Hi,
in the linux initialization, inside setup_arch, I see ld_mmu_srmmu() (I'm 
working on SPARC architecture, SRMMU is Sparc Reference MMU)
and it comprises many macro calls starting with BTFIXUP... The first two lines 
look like this

BTFIXUPSET_SIMM13(pgdir_shift, SRMMU_PGDIR_SHIFT); // ___ss_pgdir_shift 
 -- first line
BTFIXUPSET_SETHI(pgdir_size, SRMMU_PGDIR_SIZE); // ___hs_pgdir_size
...

The macro in the first line BTFIXUPSET_SIMM13 is expanded to 
#define BTFIXUPSET_SIMM13(__name, __val
do {
___ss_##__name[0] |= 1;
___ss_##__name[1] = (unsigned)__val;
} while (0)

So the first line just becomes
___ss_pgdir_shift[0] |= 1;
___ss_pgdir_shift[1] = (unsigned)SRMMU_PGDIR_SHIFT;

I looked up __ss_pgdir_shift, and found it's in arch/sparc/boot/btfix.S,
___ss_pgdir_shift:
.word 0x7300,0,68
.word   
_stext+0x000148c8,0,_stext+0x00014c94,0,_stext+0x00015348,0,_stext+0x00016310,0,_stext+0x000163c8,0,_stext+0x00016fb4,0,_stext+0x00017508,0,_stext+0x0007c31c,0,_stext+0x0007c9b0,0,_stext+0x0007da94,0,_stext+0x0007e310,0,_stext+0x0007edbc,0,_stext+0x0007f058,0,_stext+0x0007f234,0,_stext+0x0007f950,0,_stext+0x0007fbb4,0,_stext+0x00080408,0,_stext+0x00084540,0,_stext+0x00084c30,0,_stext+0x00085a60,0,_stext+0x00086598,0,_stext+0x00087b40,0,_stext+0x00087ce4,0,_stext+0x00088c54,0,_stext+0x00089f58,0,_stext+0x0008d748,0,_stext+0x003d08f4,0,__init_begin+0x659c,0,__init_begin+0x7ac8,0,__init_begin+0x8088,0,__init_begin+0x8360,0,__init_begin+0x8720,0,__init_begin+0x8908,0,__init_begin+0x8bf8,0

I think this assembly code was built before the compilation of ld_mmu_srmmu. 
(this BTFIXUP thing sounds like related to what is called pre-link, I saw it on 
the web) and This ld_mmu_srmmu function seems to setup general sparc functions 
and values into those for specific sparc sub-architectures. 
(replacing genearal things with more specific things)

So the first line is setting bit 0 of 0x7300 and overwriting 
SRMMU_PGIDR_SHIFT (=2^24) at the next word. and there is a number 68 and it is 
followed by 68 words. I can see it looks like setting up a page directory table 
with certain length.  
But how has this assembly been built during pre-link? Is there any good 
reference I can read? And Where and how are this values and functions used? 
Could somebody give me any answer?
Sorry for many hasty questions.
Best regards,

Chan
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


in sparc linux system call entry assembly code

2014-03-28 Thread 김찬
Hi,

below is a code snippet from arch/sparc/kernel/entry.S. I can't understand a 
part of it (I think I once understood it but forgot..).
#define LINUX_SYSCALL_TRAP \
sethi %hi(sys_call_table), %l7; \
or %l7, %lo(sys_call_table), %l7; \
b linux_sparc_syscall; \
rd %psr, %l0;

linux_sparc_syscall:
sethi   %hi(PSR_SYSCALL), %l4
or  %l0, %l4, %l0
/* Direct access to user regs, must faster. */
cmp %g1, NR_syscalls
bgeulinux_sparc_ni_syscall
 sll%g1, 2, %l4
ld  [%l7 + %l4], %l7
andcc   %l7, 1, %g0
bne linux_fast_syscall
 /* Just do first insn from SAVE_ALL in the delay slot */
when linux system call trap is entered, the sys_call_table address is stored in 
%l7 and %psr in %l0 and it branches to linux_sparc_syscall.
(%psr is read in branch delayed slot). From the linux_sparc_syscall, the the 
%l0 (PSR value) is set with system call bit (to indicate it's in system
 call later), and if the system call number is compared with the max value, if 
it is greater or equal, it branches to linux_sparc_ni_syscall (not implemented).
The part I can't understand follows. %l7 contains sys_call_table, so it loads 
the system call address with corresponding offset (nubmer * 4, or 2 bit shift 
left). Then what is this andcc %l7, 1, %g0 doing?

Thanks!
Chan
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


RE: how to get PFN of page cache?

2014-03-20 Thread 김찬
Oh, I see.
By PFN of page cache, do you mean the one in the memory management unit? Or is 
there another page cache for the disk cache(I’m not sure if there’s one)?
---
From: pravin jadav [mailto:pravin.jada...@gmail.com] 
Sent: Friday, March 21, 2014 1:08 PM
To: 김찬; Valdis Kletnieks
Cc: Pranay Srivastava; Kernelnewbies@kernelnewbies.org
Subject: Re: how to get PFN of page cache?

basically i need to develop kernel module that get PFN of page cache and is 
corresponding disk block number.

after getting PFN and Disk block number, user space program transfer PFN and 
Disk blick number to the source VMM and remote VMM. 

i use that module in virtual machine(VM) live migration.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


RE: Does register_chrdev function make device file under /dev ?

2014-03-11 Thread 김찬
Hi, Mandeep, Thanks for clearing some things for me.

For accessing the device in kernel code, I think maybe we can use the /proc or 
/sys file system.
(I remember seeing people saying something like that.. correct me if I'm wrong)

 I think you need to point getty or a shell to the correct tty before you
 can see o/p on the screen. Do you know which device file you're supposed
 to create for the LCD? If so, just use that in your inittab.
 Something like:
 
 ::askfirst:-/bin/sh

The problem is, after the final sys_execve() which executes /sbin/init of the 
ramdisk, I cannot see any shell coming up so I cannot use getty command.
Using some prints on separate uart print routine, I can see from the kbd_event 
function the key value is going to current vc which is using tty1. The key 
value is then handed to put_queue function where the character is somehow 
copied to tty buffer. Flush_to_ldisc is scheduled for it and it will probably 
get passed on to the virtual console.
Added to this, there is a notifier_call_chain and the notifier block is 
registered by vcs_poll_data_get function which I don't know weather is 
necessary or not. So one of my questions is  if vcs is necessary for my case. 
(I guess not. There is no other notifier blocks registered)

I gathered without inittab (I don't use inittab which should be ok for most 
cases) the assumed default inittab
tty2::askfirst:-/bin/sh
tty3::askfirst:-/bin/sh 
tty4::askfirst:-/bin/sh 
is being applied by the busybox so there maybe 3 shells on tty2,tty3, and tty4 
running somewhere.
But even if there are shells running I don't know how to switch to those ttys.
I tried using Ctrl-Alt F2 (or F3, F4) using the USB keyboard to switch to 
tty2,3,4 to see if any shell comes up on the LCD but couldn't see it.
I tried using inittab with no avail before.

I hope somebody could point me on what should be checked. Any hint will be 
appreciated.
Regards,
Chan

 -Original Message-
 From: Mandeep Sandhu [mailto:mandeepsandhu@gmail.com]
 Sent: Tuesday, March 11, 2014 6:01 PM
 To: Chan Kim
 Cc: Kernel; kernelnewbies@kernelnewbies.org
 Subject: Re: Does register_chrdev function make device file under /dev ?
 
 On Tue, Mar 11, 2014 at 1:31 PM, Kim Chan c...@etri.re.kr wrote:
 
  Yeah, I know mknod command. I just wanted to know if the
  register_chrdev makes the file or not.
 
 It doesn't. Also note that this is the old way of registering a char
 device. New code should use cdev_add() etc.
 
  To my understanding, device file is needed when a user program wants
  to access the device and we don't need to generate the device file for
  us to use the device in kernel. Is my understanding correct?
 
 Yes, device nodes are needed for userspace code to access a device (the
 good ol devices are also files Unix paradigm! :)).
 
 I'm not sure how an in-kernel access will work (maybe via directly getting
 the corresponding cdec structure).
 
 
  For example, busybox (a user program) starts shell on tty2-4 by
  default. (as the assumed default inittab below)
  tty2::askfirst:-/bin/sh tty3::askfirst:-/bin/sh
  tty4::askfirst:-/bin/sh I have had some mknod commands before in
  /etc/init.d/rcS to make tty2~tty4 device files, but when I remove them
  for test, I can see busybox (almost sure it's coming from busybox)
  complaining that it cannot find the tty2~tty4 device files.
 
 Correct. You will have to create those nodes manually.
 
 
  I am trying to open a shell on my LCD (is it going to be tty2 ? I
  don't
  know) and I'm not sure if I have to make vcs1 vcs2 vcs3 files. And I
  don't know how to switch to LCD shell. during the boot, the texts come
  out on the LCD but I cannot see the texts (printf) from busybox. and
  cannot see the shell on LCD. When I press the keyboad, it looks like
  it's connected to tty1(I can see using prints on uart window). Can
  anybody tell me some direction?
 
 I think you need to point getty or a shell to the correct tty before you
 can see o/p on the screen. Do you know which device file you're supposed
 to create for the LCD? If so, just use that in your inittab.
 Something like:
 
 ::askfirst:-/bin/sh
 
 HTH,
 -mandeep
 
 
  
  From : Kernel bu.ker...@gmail.com
  Sent : 2014-03-11 14:44:09 ( +09:00 )
  To : Kim Chan c...@etri.re.kr
  Cc : kernelnewbies@kernelnewbies.org kernelnewbies@kernelnewbies.org
  Subject : Re: Does register_chrdev function make device file under /dev ?
 
 
 
  On Mar 10, 2014, at 10:25 PM, 김찬 c...@etri.re.kr wrote:
 
  Hi,
 
  This should be a basic question.
  Does the regisetr_chrdev function make the device file under /dev
 directory?
  I am running linux on our embedded system and inside vcs_init,
  register_chrdev is called as below.
 
  int __init vcs_init(void)
  {
  unsigned int i;
  if (register_chrdev(VCS_MAJOR, vcs, vcs_fops))
  panic(unable to get major %d for vcs device,
  VCS_MAJOR);
 
  I can see the function is returning ok but I don't

Does register_chrdev function make device file under /dev ?

2014-03-10 Thread 김찬
Hi,

This should be a basic question.
Does the regisetr_chrdev function make the device file under /dev directory?
I am running linux on our embedded system and inside vcs_init, register_chrdev 
is called as below.

int __init vcs_init(void)
{
unsigned int i;
if (register_chrdev(VCS_MAJOR, vcs, vcs_fops))
panic(unable to get major %d for vcs device, VCS_MAJOR);

I can see the function is returning ok but I don't see any vcs* file under /dev.
Does it only register the device on /sys or /proc directory and not under /dev?
Thanks in advance.

Chan

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


trying to open a shell on LCD with USB keyboard..

2014-02-26 Thread 김찬

Hi, folks!
Nice to get to know this email list. I hope I finally arrived to the right 
group.
( I posted my question on stackoverflow 2 weeks ago but there's no reply. I'm 
analyzing the console-related code, it's too complex..)

I'm trying to bring up virtual terminal on our embedded system's LCD usnig USB 
keyboard which is also connected to the system. I have UART connection to my PC 
so I've been using UART for console till now but I want to switch to 
framebuffer console on LCD during the boot at some point..

The USB host controller seems to work fine because I've seen USB memory is 
attached, read and written ok. And when I connect a keyboard and print the 
events at keyboard_event function, it prints events that seem normal and 
corresponding to my action(type of key, press or release..).

The problem is that when I configure the framebuffer console in, I cannot see 
the prints from the busybox code. Maybe our system could have a problem in 
framebuffer driver (but we can run a application using the framebuffer 
/dev/fb0) with it not fully supporting framebuffer console.



But I have another feeling that it might be just a configuration problem. (So I 
want to know the right configuration at least to concentrate further..)

As you can see, in init/main.c, near the end in init_post function, there is 
(I'm using linux3.3 by the way)
run_init_process(ramdisk_execute_command);
(In my case, ramdisk_execute_command = /sbin/init)

And this immediately calls
kernel_execve(init_filename, argv_init, envp_init);
// above, init_filename and argv_init are /sbin/init same.

I expect busybox to run after this.. (ramdisk had been installed before by a 
bootloader-like part) but I cannot see any prints on the LCD after this point. 
But I can see printks on the LCD until just before calling kernel_execve above. 
I'm using linux 3.3.

I understand I have to open a frame buffer console on LCD and connect it to a 
tty but I don't know how. Below are printed the current releavant settings. (In 
serial UART connection case, linux boots ok up to the final busybox shell 
prompt printing things in busybox initialization after kernel_execve call. and 
#cat /proc/fb0 returns 0 for your info. Only LCD/framebuffer console mode stops 
after kernel_execve.)



in kernel source directory,

 arch/sparc/boot/ourprocessor/prom_stage.c : #
// console=ttyS,mmio,0xff003000,115200n8 == serial port case
console=tty0 = frame buffer console case (below line 
too)
fbcon=font:SUN8x16,map:0= Is this boot argment correct?..



in ramdisk image,

 /sbin/init: #
#!/bin/busybox sh
export LD_LIBRARY_PATH=/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nand/lib

exec /bin/busybox init
### /etc/init.d/rcS #
mknod /dev/tty0 c 4 0 == Do I need to explicitly make tty0 and tty1 like this?
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4

### .config #
CONFIG_FRAMEBUFFER_CONSOLE=y = LCD/framebuffer console case. Otherwise none.
CONFIG_FONT_SUN8x16=y
CONFIG_LOGO=y

By the way, I'm not using /etc/inittab.(so use default init). The busybox 
init/init.c code says if there isn't the inittab file and console is not the 
serial port, it runs
tty2::askfirst:/bin/sh
tty3::askfirst:/bin/sh
tty4::askfirst:/bin/sh
(starting shell on tty 2, 3 and 4) then How do make tty2's shell appear on the 
LCD/framebuffer/framebuffer console? It's confusing and books are not so kind..

Any hint would be deeply appreciated.

Thank you in advance.

Chan


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


회신: How to use pr_debug

2014-02-26 Thread 김찬

Yes, if you add line below,
console_loglevel = 8;  // 8 is debug level
The debug messages will also be printed to your console (serial port).
maybe you could revert it back after use.
Chan


From : valdis.kletni...@vt.edu valdis.kletni...@vt.edu
Sent : 2014-02-27 07:31:25 ( +09:00 )
To : m silverstri michael.j.silvers...@gmail.com
Cc : kernelnewbies kernelnewbies@kernelnewbies.org
Subject : Re: How to use pr_debug

On Wed, 26 Feb 2014 11:35:23 -0800, m silverstri said:
 I am using 'pr_debug()' to print debug statements. But I don't see
 anything in my serial console. But when I use pr_info(), I see the
 debug statements.
 Do I need to do anything to see pr_debug()?

You probably need a #define DEBUG. Also, check your console logging
level, make sure it's set to output debug-level to the console.

/proc/sys/kernel/printk and 'dmesg --console-level' are your friends.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies