hi
I have two code of user.c and kernel.c , i have compiled new kernel in my system , but i don't know how to compile these code.
may i use any IDE or GCC.
Hi all,
In my work, I'd like to spawn separate kernel threads (tasks) to execute syscall asynchronously. Specifically, a user thread issues a syscall, goes into kernel, save the syscall number and arguments somewhere in the kernel address space, but does not execute the syscall. A kernel thread which is different from the user thread, will fetch the syscall number and arguments to execute the syscall on behalf of the user thread.
But for file operations such as read, the kernel thread is not aware of the open files of the user threads. For example, if the user thread opens a file and get a file descriptor, then it issue a read() syscall. The kernel thread cannot execute the read() on behalf of the user thread by just using the file descriptor. Thus I need some way to allow the kernel thread share the open files information with the user thread, such that the kernel thread will have the context of the open file to execute read(). I tried to pass the files_struct of the user thread's task_struct to the kernel thread, but it didn't help, read() returns a EFAULT error.
Can anyone give me some suggestions on how to make a kernel thread share the open files with a user thread? Or more straightforward how to execute the read() syscall in the example above in kernel thread? Thank you very much!
--Louis
I have installed Linux 3.5 kernel and have compiled e2fsprogs as well. I have my own version of ext3 file system - lets say it is myfs. I have compiled myfs as well. Now I have few questions:
1.How to insert myfs module and where? When I do modprobe myfs (.ko file) it says module not found. When I simply do insmod myfs.ko it works but I am not sure where is it putting the .ko file. Also the displays I have added (on mkdir call) are not showing up (kernel debug level is also set to 8) when I try to create a directory in mounted folder
Makefile in myfs directory looks like this:
KERNEL_TREE ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
obj-m := iext3.o
iext3-objs := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
ioctl.o namei.o super.o symlink.o hash.o resize.o ext3_jbd.o \
xattr.o xattr_user.o xattr_trusted.o acl.o xattr_security.o icefs.o \
transaction.o commit.o recovery.o checkpoint.o revoke.o journal.o
all:
make -C $(KERNEL_TREE) M=$(PWD) modules
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.markers *.order *.symvers
and I am compiling myfs from my own directory: /home/myname/soft/myfs.
Also, I don't see any ext2/ext3/ext4 directories in /lib/modules/linuxversion/kernel/fs/ -- not sure if this is right or wrong.
2.Mount is working fine. I can see myfs is mounted on /dev/sda3 by doing df -a. When I unmount It says - umount: /home/..../mnt: not mounted and then if I do df -a the file system is unmounted. This is strange as its unmounting but still throwing error.
Some Background: Directory where I have everything: /home/soft myfs/ mye2fs/ Linux-3.5/ mnt/
Step1: cd Linux-3.5 --> 1) make 2) make modules 3) make modules_install 4) make install 5) reboot
Step2: compile myfs (my version of ext3) and insert the myfs kernel module --> cd myfs/ --> make --> insmod myfs.ko
Step3: compiled mye2fs for mkfs
Step4: use mye2fs to create myfilesystem on a device --> mount --> test printk statements put under myfs modules
I am trying to compile a small C program on Slackware 13.37 that uses libpcap libraries. When I do
PHP Code:
gcc app.c -lpcap
it throws error:
PHP Code:
/usr/stuff/app/libpcap/pcap.h:46:25: fatal error: sys/types.h: No such file or directory
If I correctly understand, this has something to do with not having
PHP Code:
kernel-headers
installed. If so, how can I install kernel-headers on my system? Or am I misunderstanding the problem?
Also, the directory where /sys/types.h is supposed to be located is completely empty - /usr/include/
lsmod is command to list loaded modules and I referred man page of lsmod that shows it refers to /proc/modules file. In terms of my os platform, Ubuntu, almost available modules are in /lib/module directory. I think OS kernel naturally loads modules in there. So, What does kernel refer to load modules at boot time?
Is there any files to be refereed for loading or mechanism can't know easily for end user?
I have a USB fax modem, and it logs the following errors when turned on.
I know it is impossible to know for sure, but think it is hardware related? Any chance to salvage?
Also, what are the steps to start troubleshooting?
Thanks
Code:
Jan 17 14:38:26 devserver kernel: generic-usb 0003:0461:4D0F.0066: input,hidraw2: USB HID v1.11 Mouse [PixArt USB Optical Mouse] on usb-0000:00:1a.0-1.2/input0
Jan 17 14:38:41 devserver kernel: usb 3-1: new full speed USB device number 24 using xhci_hcd
Jan 17 14:38:41 devserver kernel: usb 3-1: device descriptor read/all, error -71
Jan 17 14:38:41 devserver kernel: usb 3-1: new full speed USB device number 25 using xhci_hcd
Jan 17 14:38:41 devserver kernel: usb 3-1: device descriptor read/all, error -71
Jan 17 14:38:41 devserver kernel: usb 3-1: new full speed USB device number 26 using xhci_hcd
Jan 17 14:38:41 devserver kernel: usb 3-1: device descriptor read/8, error -71
Jan 17 14:38:41 devserver kernel: usb 3-1: device descriptor read/8, error -71
Jan 17 14:38:41 devserver kernel: usb 3-1: new full speed USB device number 27 using xhci_hcd
Jan 17 14:38:41 devserver kernel: usb 3-1: device descriptor read/8, error -71
Jan 17 14:38:42 devserver kernel: usb 3-1: device descriptor read/8, error -71
Jan 17 14:38:42 devserver kernel: hub 3-0:1.0: unable to enumerate USB device on port 1
OK,
Lastnight I decided to finally attempt to install the dedicated ATI/AMD Catylist drivers. After all I was successfull with the HP drivers, right...
No matter which grub selection I make, getting in is broken, except of course for the Windows XP Pro x64 entry, that works just fine. I'm here with you today, because of the Fedora 21 Live DVD, (slooooww).
Here is the drivers log file:
==========================================================
Supported adapter detected.
Check if system has the tools required for installation.
Uninstalling any previously installed drivers.
Unloading radeon module...
rmmod: ERROR: Module radeon is in use
Unloading drm module...
rmmod: ERROR: Module drm is in use by: ttm drm_kms_helper radeon
[Message] Kernel Module : Trying to install a precompiled kernel module.
[Message] Kernel Module : Precompiled kernel module version mismatched.
[Message] Kernel Module : Found kernel module build environment, generating kernel module now.
AMD kernel module generator version 2.1
doing Makefile based build for kernel 2.6.x and higher
rm -rf *.c *.h *.o *.ko *.a .??* *.symvers
make -C /lib/modules/3.18.3-201.fc21.x86_64/build SUBDIRS=/usr/lib/modules/fglrx/build_mod/2.6.x modules
make[1]: Entering directory '/usr/src/kernels/3.18.3-201.fc21.x86_64'
CC [M] /usr/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
/usr/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:6396:12: warning: ‘KCL_fpu_save_init’ defined but not used [-Wunused-function]
static int KCL_fpu_save_init(struct task_struct *tsk)
^
CC [M] /usr/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o
/usr/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.c: In function ‘KCL_ACPI_Slot_No_Hotplug’:
/usr/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.c:845:21: error: ‘struct acpi_device_flags’ has no member named ‘no_hotplug’
tdev->flags.no_hotplug = true;
^
scripts/Makefile.build:257: recipe for target '/usr/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o' failed
make[2]: *** [/usr/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o] Error 1
Makefile:1385: recipe for target '_module_/usr/lib/modules/fglrx/build_mod/2.6.x' failed
make[1]: *** [_module_/usr/lib/modules/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory '/usr/src/kernels/3.18.3-201.fc21.x86_64'
Makefile:88: recipe for target 'kmod_build' failed
make: *** [kmod_build] Error 2
build failed with return value 2
[Error] Kernel Module : Failed to compile kernel module - please consult readme.
[Reboot] Kernel Module : dracut
==========================================================
I just rebooted without attempting to configure the card, as per the ATI/AMD warning stating that it's important to do so, because my thinking was derailed due to seeing errors, and the install program said I needed to reboot. Afterall, I just couln't believe that with a "Failed to compile kernel module" error, it would actually keep the changes I'd made, that surely Linux had a failsafe in place for such circumstances. In other words, I'm also a newbie, and just don't know how many hoops of fire one has to jump through to be at peace with linux.
Can anyone please help be get back into my install, I've already set up so many things, there's just got to be a way, right?
Thanks in Advance!
JustAnotherHuman
I'm currently reading Brian Wards book: How Linux Works: What Every Superuser Should Know 2nd edition and I'm confused about step 3 in the context of the other steps:
1. The CPU (the actual hardware) interrupts the current process based on an internal timer, switches into kernel mode, and hands control back to the kernel.
2. The kernel records the current state of the CPU and memory, which will be essential to resuming the process that was just interrupted.
3. The kernel performs any tasks that might have come up during the preceding time slice (such as collecting data from input and output, or I/O, operations).
4. The kernel is now ready to let another process run. The kernel analyzes the list of processes that are ready to run and chooses one.
5. The kernel prepares the memory for this new process, and then prepares the CPU.
6. The kernel tells the CPU how long the time slice for the new process will last.
7. The kernel switches the CPU into user mode and hands control of the CPU to the process.
What does he mean preceding time slice as surely the tasks have been completed during the time slice in steps 1-2?
Hi! I have a failing disk and the kernel messages are the following:
Code:
Απρ 01 15:07:02 Arch kernel: ata1: lost interrupt (Status 0x50)
Απρ 01 15:07:03 Arch kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Απρ 01 15:07:03 Arch kernel: ata1.00: failed command: WRITE DMA
Απρ 01 15:07:03 Arch kernel: ata1.00: cmd ca/00:08:20:32:6a/00:00:00:00:00/e4 tag 0 dma 4096 out
res 40/00:00:4b:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
Απρ 01 15:07:03 Arch kernel: ata1.00: status: { DRDY }
Απρ 01 15:07:03 Arch kernel: ata1: soft resetting link
Απρ 01 15:07:03 Arch kernel: ata1.00: LPM support broken, forcing max_power
Απρ 01 15:07:03 Arch kernel: ata1.00: LPM support broken, forcing max_power
Απρ 01 15:07:03 Arch kernel: ata1.00: configured for UDMA/133
Απρ 01 15:07:03 Arch kernel: ata1.01: configured for UDMA/133
Απρ 01 15:07:03 Arch kernel: ata1: EH complete
Απρ 01 15:09:19 Arch kernel: ata1: lost interrupt (Status 0x50)
Απρ 01 15:09:20 Arch kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Απρ 01 15:09:20 Arch kernel: ata1.00: failed command: READ DMA EXT
Απρ 01 15:09:20 Arch kernel: ata1.00: cmd 25/00:20:e8:b2:fd/00:00:18:00:00/e0 tag 0 dma 16384 in
res 40/00:00:4b:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
Απρ 01 15:09:20 Arch kernel: ata1.00: status: { DRDY }
Απρ 01 15:09:20 Arch kernel: ata1: soft resetting link
Απρ 01 15:09:20 Arch kernel: ata1.00: LPM support broken, forcing max_power
Απρ 01 15:09:20 Arch kernel: ata1.00: LPM support broken, forcing max_power
Απρ 01 15:09:20 Arch kernel: ata1.00: configured for UDMA/133
Απρ 01 15:09:20 Arch kernel: ata1.01: configured for UDMA/133
Απρ 01 15:09:20 Arch kernel: ata1: EH complete
I have 2 disks: sda, sdb. Which disk is it referring to?
Thanks a lot
Dear Sir.
U-boot version : 2015.01
I'm setting some env value. for example see below.
Code:
U-boot > printenv
serial_number=abcdefg
I'm want to "serial_number" pass to kernel cmdline.
So, I'm make a "bootargs" env value. see below.
Code:
U-boot > printenv
bootargs='console=ttyS0,115200 board_serial=${serial_number}'
But, i was failed that env serial_number pass to kernel.
Code:
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: console=ttyS0,115200 board_serial={serial_number}
How can u-boot env variable pass to kernel?
Thank you.
Hi.
I'm using smstools3 and Sony Ericsson Phones to send SMS. My system did work well with 4 phones, now I want to connect 20.
The issue is that each phone generates two ttyACMXX devices using cdc_acm driver, and for limitations the driver supports up to 32 ACM devices
Code:
Aug 31 09:51:19 smsgw kernel: cdc_acm 2-2:1.1: ttyACM31: USB ACM device
Aug 31 09:51:19 smsgw kernel: cdc_acm 2-2:1.3: ttyACM32: USB ACM device
Aug 31 09:51:19 smsgw kernel: usbco registered new driver cdc_acm
Aug 31 09:51:19 smsgw kernel: drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters
Aug 31 09:51:19 smsgw kernel: usbco registered new driver cdc_ether
Aug 31 09:51:19 smsgw kernel: usb 2-2: unsupported MDLM descriptors
Aug 31 09:52:01 smsgw kernel: cdc_acm 3-1:1.0: no more free acm devices
From the ttyACM devices created by the driver I only use the first one..
So I was wondering if it is possible to remove a ttyACM from /sys/class/tty/ttyACM1
I tried unlink /dev/ttyACM1, but it persist as a device on /sys/class/tty/
The devices are removed if I disconnect the phone, So I think would be possible also that the driver only create one ttyACM device..
Please guide me...
Thanks in advance.