hardware

RaspberryPi RS-232 trouble

痞子三分冷 提交于 2019-12-11 06:43:15
问题 I am using the RS-232 lines on my Pi to communicate with a laser range finder. I have tested the communication between the two using minicom at a baud rate of 19200(because that is the baud rate of the LRF and can't be changed), and it works fine. Although writing down to the LRF any commands(which consists of a single character and pressing 'enter') can take several attempts to take affect, communication in both directions works great. However, when I start programming in C code to read and

Retrieving graphics/sound card information on Windows

走远了吗. 提交于 2019-12-11 04:24:34
问题 I'm working on a bug reporting tool for my application, and I'd like to attach hardware information to bug reports to make pinpointing certain problems easier. Does anyone know of any Win32 API functions to query the OS for information on the graphics and sound cards? Thanks, Rob 回答1: If your willing to dig into WMI the following should get you started. using System; using System.Management; namespace WMIData { class Program { static void Main(string[] args) { SelectQuery querySound = new

Chisel runtime error in test harness

…衆ロ難τιáo~ 提交于 2019-12-11 04:01:14
问题 This Chisel code works ok: chiselMainTest(Array[String]("--backend", "c", "--genHarness"), () => Module( new Cache(nways = 16, nsets = 32) )){c => new CacheTests(c)} However this one - a small variation - produces run-time error: val cache_inst = new Cache(nways = 16, nsets = 32) chiselMainTest(Array[String]("--backend", "c", "--genHarness"), () => Module(cache_inst)){c => new CacheTests(c)} [error] (run-main) java.util.NoSuchElementException: head of empty list java.util

On DMA and CPU Concurrency

时光怂恿深爱的人放手 提交于 2019-12-11 03:53:46
问题 I wondered what sort of operations can CPU handle/perform while a memory operation is in progress by a DMA-controller of a device, to increase the level of concurrency? And if the CPU cache/registers is empty, how another instruction can be fetched without interleaving DMA in progress Thx 回答1: It general, on big 1 hardware, the CPU can do more or less anything while a DMA is in progress. In general, it simply continues with normal execution of running processes or kernel tasks under the

Is it a good idea to read multiple files at the same time?

荒凉一梦 提交于 2019-12-11 03:37:10
问题 One of our company's server has 32 CPUs, and we have 1000+ very large files to be processed. I'm not sure if it is a good idea to read 32 files at the same time so all cores can perform independent calculations at the same time too. Could anyone briefly explain how hard disk works? If I read 32 files at the same time, would that slow down the reading speed? Thanks! 回答1: The hard disk is traditionally a mechanical data storage device. I'm assuming the server uses mechanical ones, and not the

Hardware breakpoints EXCEPTION_SINGLE_STEP all the time

时光怂恿深爱的人放手 提交于 2019-12-11 03:35:04
问题 I have a program that acts as a debugger. I set a hw bp for a thread setting dr0 to the address I want to bp to be in and dr7 as 1 because I want the bp to generate an event each time that address is executed. It works but the problem now is that I don't stop receiving the EXCEPTION_SINGLE_STEP all the time. I created a loop with WaitForDebugEvent as normal: DebugActiveProcess(pid); while (flag == 0) { WaitForDebugEvent(&DBEvent, INFINITE); if (first_time){ setHWBPInCurrentThreads(pid,

Using “statfs” on Mac OS X?

我是研究僧i 提交于 2019-12-11 03:29:04
问题 I need to retrieve information about a hard disk and am using the statfs function to do so. When your computer displays free space on the HD, does it use "free blocks" or "free blocks available to unpriveleged user"? Does statfs work with SSDs? How would the "path" to the main hard drive be stored? On windows it's generally C:, but I am new to OSX. The man pages don't seem to provide a very comprehensive look of how statfs works. Mac OSX Snowleopard using C/Objective-C. Xcode 3.2.6 回答1: 1)

How to detect differences in floating point behaviour across platforms

亡梦爱人 提交于 2019-12-11 02:53:35
问题 What checks can I perform to identify what differences they are in the floating point behaviour of two hardware platforms? Verifying IEE-754 compliance or checking for known bugs may be sufficient (to explain a difference in output that I've observed). I have looked at the CPU flags via /proc/cpu and both claim to support SSE2 I looked at: https://www.vinc17.net/research/fptest.en.html http://www.jhauser.us/arithmetic/TestFloat.html but they look challenging to use. I've built TestFloat but I

How do I write to registers in hardware using Python?

拈花ヽ惹草 提交于 2019-12-11 01:57:25
问题 I have a C function which can read/write perfectly into the hardware register by opening the device descriptor (nf10). I am trying to do the same using Python. I am able to read the registers, but I am not able to write registers. Why am I unable to write? Is there a better way to do read/write for registers in hardware? Relevant Python code: #! /usr/bin/env python import os from fcntl import * from struct import * SIOCDEVPRIVATE = 35312 NF10_IOCTL_CMD_READ_STAT = SIOCDEVPRIVATE + 0 NF10

iPhone dev box?

依然范特西╮ 提交于 2019-12-11 00:31:26
问题 I would like to try some iPhone development but am not a Mac user. I'm not keen to spend a load of cash on a new mac, so if I were to buy an old Mac on ebay, what system should I look at as a minimum for an acceptable iphone dev machine. Cheaper the better obviously. Note: Not keen on running mac os on a pc so really looking for an apple hardware option. Is an old mac mini suitable? 回答1: Any Mac with an Intel processor will do fine. 回答2: You can spend your time searching eBay for an old Intel