General :: Getting Notified In User-space On Interrupts?
Jun 27, 2010
I hope this is the right place to post to because I haven't found any other related forums.I'm working on an AMD opteron running Linux 2.6.28.6 I want to preload a hardware performance counter (register) with a value to have it overflow after a number of a specific event counts. As I understand, when the counter in the register overflows, an interrupt will be generated and handled by the appropriate interrupt handler. How can my user-level application get notified whenever the interrupt occurs? I want to obtain information on the instruction that caused the overflow. Is this possible? I think this is different than responding to signals with sigaction().
I am trying to figure out how to mask local timer interrupts on a specific core of a multicore system from within user space. The interrupts are causing latency spikes of 3-10u that we would like to remove. We are only running 1 thread on the core h everything shielded except for these timer interrupts. This thread makes no system calls and thus is never getting context switched out. I am not looking to turn them off entirely but rather turn them off, run my code, turn them on in a continuous loop. The thread runs in user space which we are hoping to maintain. We also have no desire to modify the kernel if possible. I've read about using spinlock_irqsave() but it appears (not positive) that it must be used within kernel space.
Logical Memory Space of 4GB is divided in to 3GB User Space and 1GB Kernel Space. Always. Correct?
1. How can we change it? (just changing value of PAGE_OFFSET is okay?)
2. If system have only 256MB of memory (embedded system) and suppose Kernel Modules eat away all the memory during boot. User space will be left will no memory. Is this case possible?
I am writing device driver in which i have to call callback function from kernel space, which are saving my data. But the callback functions are in userspace. While accessing them i am getting segmentation fault.
In a 32-bit system, max memory addressable is 4GB. Now Linux kernel does memory mapping division of 1GB for kernel address space and 3GB for user address space. That means 4GB of virtual address space is divided between kernel (1GB) and user (3GB).
Q1. All virtual mapping utilizes the available physical RAM without any division? I mean to say that if RAM is 512MB then a page in kernel space can lie any where RAM (leave aside old PCI dma accesses)? (How this fits to fact that kernel memory is non-pageble)
Q2. If a process is created in user space, it has visibility 4GB address space or 3GB address space?
I am developing a I2C CDROM client driver. The CDROM firmware supports TOC information read through a I2C command. It sends the TOC information in burst ( Interrupts a GPIO pin when it is ready ) and my CPU does a I2C read to read the TOC. When the CDROM firmware finishes sending the last data burst , it informs my CPU that it is done with the TOC, by a flag in the last data burst. I would like to know, which is the most efficinet way I can send these TOC information to userspace?
I wanna write a file in kernel space but from my searching I can to know that instead of writeing file in kernel space ,I can write data to user space by copy_to_user space.
But link is missing ...I dont know how will my user space will access kernel space means my function in kernel space which will do copy_to_user /....How my user space function will call my kernel level function ..
Can any one of you provide me with some example file which are doing this .I know every char driver is using it ...but i could not trace back how user level function is accessing it ...i m confused between user space and kernel space.
I have the following requirement in my module. The driver gets some data from the external device. After getting 1MB of data it has to send it to the user space application. What is the best thing to implement for this in driver.? Is it ok to implement like, after getting data, the driver will send a signal to the user space application. Then the user space application sends an ioctl to read the data. Is there any alternate, that the driver directly sends the data without the user space application asks for it.?
I am working on development of an TOS that runs in Protected Mode. I am required to switch it from text mode to graphics mode. Everywhere I google I get only one solution set AX to 0013h and call INT 10 and easily the VGA Graphics Mode is set.
I am working in protected mode and hence cannot use INT 10. Can someone please guide me? I came across a post where it was said that this can be done by setting the VGA registers, but I could not understand much from the link provided in the post on how to implement it.
cusexmp, the example of CUSE program, works. Is there real programs that makes use of it? For example, a thing that just mirrors other character device or thing that allows networked character devices.
I've been looking to get some torrent downloads running on school servers, but I obviously can't install a torrent client because I don't have root (and by extent, can't run anything requiring root privileges). Servers are running various versions of Red Hat (at least the x86_64 ones are, I don't want to recompile if I don't have to). Google has failed me thus far.
I need a shared buffer between user and kernel space. I read that one way is to allocated buffer in kernel and then call mmap from the user space. I searched for an example but couldn't find something useful. If you know, could you please send me any links or sample code that does this..
There are some user-space based NFS clients (e.g. NFS Client library). Can I bypass file permissions by using such client? code...
Client1 uses usual NFS client (kernel-mode based) and user1@client1 can read only file1, but not file2. As I understand, client1 sends uid in nfs request, server1 do a permissions check based on the request data. So, I suggest this is possible to have a client2:
Client2 uses user-space client, and hacker@client2 knows uids of user1 and user2; If he wants to read file1 he can send uid of user1; if he wants to read file2, he sends uid of user2.
For the past few days I was putting effort on understanding the software control flow starting from "Boot loader" to "Linux User space".
I am consolidating the entire process and putting forth in this forum...It would be great if someone can validate this..It might be useful to other new bees too.
Step 1 : Power up the board
Step 2 : The CPU control goes to EEPROM/storage memory where BIOS resides
Step 3: BIOS gets loaded in RAM and gets executed
Step 4: During execution, the selection of Boot device has to be done with the help of BIOS Menu [Blue screen appearance during start up in normal PC's]
Step 5: BIOS shall access the Bootloader stored in boot device [for eg.,Hard disk]. Boot loader is stored in MBR area.
for explanation purpose I take the following configurations
Bootloader = GRUB Boot Device = Hard Disk
Step 6: GRUB shall be loaded in RAM and gets executed
Step 7: GRUB shall load the KERNEL image to RAM. Kernel image is stored in Hard Disk.
The question of "How the GRUB knows where the Kernel image is stored".
The answer is 1. In the "Grub.config" file, the location of "Kernel Image" and " Ramdisk Image" [which will be discussed later in the section] is being given.
Step 8: Kernel Image followed by Ramdisk Image is loaded in RAM by GRUB bootloader
Step 9: Kernel Image gets executed...During execution, top portion of the code shall make initial hardware initialization and latter part of the code shall just decompress the Kernel Image
Step 10 : After decompressing the Kernel Image, it shall decompress the already loaded Ramdisk Image
Ram disk is just creating a temporary hard disk in RAM. The main responsibility includes it consists of minimal driver files, executables, directory structures to created a TEMPORARY ROOT FILE SYSTEM.
This Temporary Root File system shall be used by Kernel Image
1. Execute the executables to access the Hard disk 2. For creating Permanent Root File System in HARD DISK
Step 11 : Kernel Shall look for the file /Linuxrc in Ramdisk. Linuxrc is a USER script file [not sure]
Step 12: At the end of script file Linuxrc, the Ramdisk shall give the control to "USER SPACE" [path for writing the script not known]in Linux kernel
I sort of asked this question in the arch linux forums since I was interested in arch but I still have yet to get a response (maybe it's too early).I wan't something like gentoo but without taking up unnecessary space like gentoo's portage does (/usr/portage/). I find that to be a serious flaw with gentoo. Yes you can use squashfs-unionfs to help but it requires some work especially when something goes wrong with portage.I was thinking about arch but can you use it completely as a source based distro? Some people seem to have said it requires scripting and some work from the user. I wan't something that'll do it for me so I can set it and forget it.
I heard about source mage linux and exherbo but I'm not sure what to think. I'm thinking about trying arch linux and source mage but perhaps there's other distro's I don't know about. I'd really like some suggestions.
i'm in search of Script that sends a mail to the user if the mount point goes beyond 80% of its full space. send mail is configured in the system so that it can communicate with mail server.
I have Icinga running on 9.04 perfectly (I used the quickstart guide), with one exception, I would like to get email notifications. The default commands are as follows,
I am forced, (from a higher power) to allow a script to run on my boxes that adds/deletes user accounts at will. It runs in cron.d. I would really like to be notified via email only if an account is added or deleted. I was thinking of a big process of copying the /etc/passwd file, doing a diff after the script runs, pumping the results to a file, then using mutt to send me the results only if the file has been updated. Problem is that it is kind of a bulky process and even if diff doesn't find any differences, it still updates the file.
I've had Fedora 15 installed on this machine for about three weeks. Today I installed Q-cad for the first time and open it to make sure it would launch. I left the machine for about an hour and when I opened the desktop, I was notified of 879 updates. A quick glance and the updates applied to everything from grub to gimp and lots in between. is it normal to have so many updates dumped to me all at once?
In OpenSuSE 11.2 YaST -> Online Update Configuration I can configure how often the system should check for updates (i.e. daily, weekly). Does this operate independently from the Online Update Applet(kupdateapplet)? The reason I ask is that the Applet doesn't always seem to work correctly. However, if the system will check for online updates automatically regardless of the Applet, perhaps this isn't an issue. If I can avoid messing with the Applet, that would be great.
I was installing freebds for one of my friends and during the entire install the top never crossed 1.0. When I install linux top always shows a cpu load of more than 1.0.Also on the bsd when copying a huge file (4gb) it takes a long time but then the load never goes beyond 1.0. Linux will do it much faster but then there is a difference in the cpu load time.What I want to know is is there anyway I can interupt the processor so that the load does not go beyond 1.0.
I'm trying to understand how interrupts work. Is there a way to generate timer interrupts in C. Also can we enter into the protected mode of the CPU. Does OS (specifically, linux) place any restrictions on user programs entering protected mode. If it does not, do we just have an assembly language program which changed the mode, followed by the C code... I'm just trying to understand how things work at the lowest level. So I'm trying to write few snippets to test my understanding.
So I've been researching this on my new NAS. I just tried to register the IP on the new system to have an issue pop up that says: "msk0: watchdog timeout (missed Tx interrupts) -- recovering" The error repeats then ends with no set IP. I tried the loader.conf fix but I cannot write to the system its installed on (embedded on a harddrive + data + swap) but it gives me a issue with write privileges which I thought would have been fixed by chmod +w /cf.