Redirect messages directed at the GPU [closed] - c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Is there anything as low level as that on any Linux distribution? My overall goal is to redirect the message (instruction) meant for the GPU.
That means I would have to be able to program a driver between the CPU and the GPU which redirects any message to where I'd like (like a packet sniffer, but for GPU instructions and one that would stop the info there).
Is there any native Linux support for this kind of thing? Where do I start and what OS is most recommended for this kind of access?

You would need to modify the GPU driver. There you can insert logging or whatever other redirection you have in mind. Since many graphics drivers on Linux are open-source, this should be possible for many graphics cards. But take note that it won't be portable--you'll need to write some separate code for each major variant of GPU you want to support.
If you have something more specific, like that you're trying to capture OpenGL commands, that might make things easier.

Related

C - Linux create sound in kernel mode [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I need o write a kernel mode driver that plays a note when a key is pressed. I can capture keystrokes but I have no idea how to play sound from kernel. What do I have to do to play a sound? I am brand new to creating drivers.
I need o write a kernel mode driver that plays a note when a key is pressed.
Why?
Seriously, why. What's the reasoning behind this "need"? What's the true reason for the need to play a sound? Maybe there is a better way.
Assuming a PC, with the pcspkr module loaded, you can of course call its functions. But if you want to play something through the soundcard, you'll essentially have to "open" an ALSA device (inside the kernel), and call its fops, all along while user space may do the same thing.

Best practices for securing an embedded device [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm currently developing an embedded controller, which will be connected to a potentially hostile environment. Since the Controller is quite limited (~50 MHz, ~16 KiB RAM), I do not have the luxury of an operating system which can help me with memory protection.
What is considered best practices for securing an embedded device? I know of techniques like stack guards, but since I'm not familiar with embedded development, I'm looking for some kind of guidance.
Edit: I'm using an ATSAMD21G18, which does not have an MMU. It's the same as used on many Arduinos. The controller will be conntected to a public bus (as in wiring, not the transportation method) thus I cannot assume anything about the behaviour of other bus members.
I am however not trying to protect IP, e.g. I'm not worried about somebody figuring out the contents of my controller. It's more about application security, e.g. how do I limit the harm done by somebody trying to take over my controller by exploiting e.g. buffer overruns.
Automotive MCU:s typically have a "copy cat" protection which blocks any form of debugger access - you can't read anything out of the MCU or debug it while this is active, you have to erase everything.
Check out MCU:s by silicon vendors with a lot to automative customers, such as NXP/Freescale or Renesas.

How to write my own virtual machine like VirtualBox? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I would like to write virtual machine. Ideally I want to write program, which will be run(emulate) windows 7(from .iso) and show it in window on Windows 7 parent. But I can't understand how to do it. I understand how to emulate cpu, for example, just write wrapper(interface) which will be provide real cpu resources(http://www.codeproject.com/Articles/43176/How-to-create-your-own-virtual-machine), but what next? how to run OS, which will be use this abstraction interface of cpu. Bios starts OS, should I emulate bios? how to do it? From what should I start? Please, describe me the basic steps to implement my task.
Thank you very much!
I'm sure years and years of work go into these type of programs. However, to get a taste of emulating CPU and coding it yourself, have a look at nand2tetris.
It starts by looking at the logic and arithmetic first, slowly working your way towards program control, high-level language and making a operating system.
Hope this helps!
(BTW it provides all materials and software for free!)

Save data in memory on LPC1768 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying save data in memory on LPC1768. I want to load data when I put on the microcontroller. I expect data don't erase when I put off the machine.
I'm programming in C. I would need a example code in C but I fount a example code in C++ only: http://developer.mbed.org/users/okano/code/IAP/
Thanks everybody. Bye.
You can write data to the flash on the LPC1768 using the IAP commands documented in the user manual in Chapter 32 "Flash memory interface and programming". Specifically, section 32.8 documents the IAP (In Application Programming) commands that let the program running on the device write to flash. Or you can write to the flash using the ISP (In-System Programming) serial port protocol documented starting in section 32.3.
You can use a tool like Flash Magic or lpc21isp to program using the ISP protocol if you don't want to roll your own.

Would an ARM Processor be the way to go? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was making a little device that would have three buttons (like the ones at radioshack) and each preform its own action. These buttons and their actions would be controlled by a very small real time operating system that I would put on this device.
Would I need an ARM Processor in any way?
How would I put the real time operating system on the device?
What OS would I have to compile this on (ex. Ubuntu? Mac OS X? Windows 7?)?
Are there any examples of anyone doing this?
P.S. No prebuilt boards (ex. arduino). I would build the board myself.
Any feedback would be greatly appreciated!
Even if you don't want to use a prebuilt board in the finished product, I'd recommend getting a prebuilt board (like the Arduino), build your product, program it, test it, etc. while on the breadboard, and then simply rebuild it however you want, using the same hardware as you've been using.
That helps you out especially the next time you're building something, because you already have the prototype board and the toolchain ready to go.
Compiling your files can be done on any OS.
Enumerated version:
No, and I wouldn't even recommend using an ARM processor; but rather an Atmega328 or similar.
Using a programmer.
Any.
Probably millions, or at least hundreds of thousands of examples, yes.

Resources