Re: Linux on Sun e10k

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
Date: Sat, 27 Jan 2007 12:17:53 +0100 (MET)

> 
> >Looking at init/main.c:
> >
> >if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
> >   printk(KERN_WARNING "Warning: unable to open an initial console.\n");
> 
> That looks almost like a bug :-/
> "/dev/console" will decay into a pointer to kernel space, but
> sys_open takes a userspace one. The __user annotation does not
> change that. Try adding this:
> 
> >... so, if root is mounted (over nfs), and root is mounted rw,
> >and /dev/console exists on the nfsroot, and it has rw permissions (I
> >gave it chmod 777 to just be sure), why would that sys_open call fail
> >and trigger that printk?
> 
> int ret = sys_open((const char __user *)"/dev/console", O_RDWR, 0);
> if(ret < 0)
>   printk(KERN_WARNING "Warning: unable to open an "
>          "initial console (%d)\n", ret);
> 
> I wonder what return code it will give (-EFAULT is my guess).

It's not getting -EFAULT, the init task runs with set_fs(KERNEL_DS).

It's getting -ENOENT because no console device has registered
itself, and therefore even if you have a /dev/console node in
the filesystem the open will still fail.
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux