How can one park the hard drive? [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
How can I park the hard drive using C?
Park: To move the hard drive head from the hard drive to a safe location. This was done
to make sure the head would not damage the disk when the computer shuts down.
I'm just curious.

This hasn't been needed in many years. Modern hard drives will automatically park the read heads when shutting down. Also, as mentioned in Oli Charlesworth's comment, that functionality would have to be provided by some sort of device driver and its associated API. There's nothing in C that you can just call to do that.

It's no longer necessary to park the HD heads, as most HDs do it automatically nowadays, and are pretty good at protecting yourself. However, should you wish to pursue further, look at this detailed description of interrupt 13H. Seems like the function 19H may achieve what you need.
But why would you like to do this? This can easily hard crash your OS, since your HD would probably be busy doing other things at the time (such as basic OS services, and other applications). And there's a good chance of data loss from this crash, as the applications probably won't have a chance to flush data to the HD - since you just parked it.

Related

aes ctr 128 bit decryption in Embedded system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
As part of DFU(Device Firmware Upgrade) we need to decrypt the binary which comes from PC. The Decryption algorithm shall be AES CTR 128 bit decryption. Since chip(TI DM3732) doesn't support h/w decryption need to implement s/w decryption. I see there are many libraries available for invoking "AES_encrypt" API, but i'm not able to integrate it to my codebase. Can anyone please help me how to proceed?
Note: Posted as an answer because it's too long to post as a comment.
Without wishing to sound too negative, I think the best answer is that if you can't integrate a reliable crypto library into your codebase, then you'll just have to find someone who can.
Here's why: Decent cryptography software isn't easy to write. If you trawl through SO and other sites, you'll probably find code that does what you want. However, unless this software has been thoroughly peer-reviewed and stress-tested, it will most likely be vulnerable to all sorts of side-channel attacks. It may even have bugs that will cause it to operate incorrectly under certain circumstances.
We seem to be advancing into an era when even ordinary objects like kettles and even toilets can connect to the internet. And because manufacturers have been cutting corners when it comes to security, these devices are easy to commandeer. As a result, we are starting to see massive botnet attacks originating from "smart" home devices.
Bruce Schneier spelt out the dangers in a speech to the House of Representatives’ Energy & Commerce Committee just last week:
Everything is now a computer: This is not a phone. It’s a computer that makes phone calls. A refrigerator is a computer that keeps things cold. An ATM machine is a computer with money inside. Your car is not a mechanical device with a computer. It’s a computer with four wheels and an engine… And this is the Internet of Things, and this is what caused the DDoS attack we’re talking about.

How to create distributed file system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Just for self education I decided to implement "hello world" distributed file system. The simplest one. And decide to read about theory under this subject.
But... when I asking google about this it shows answers like "how to configure hdfs" or "how to set distributed fs on windows" what is not what I interested in...
Could someone please point me on some good articles or books on this subject.
Thanks a lot!
Well, if you really decided to implement such a file system, you must start with distributed systems. I recommend reading the Tanenbaum reference book http://www.distributed-systems.net/index.php?id=distributed-systems-principles-and-paradigms
Careful, the subject is really complex and distributed systems are all but simple to implement.
If you want to have a look to some already implemented distributed file systems, you may have a look to GFS/GFS2 (from RedHat). You may also have a look to ocfs2 from oracle.
You may also have a look to gluster https://fr.wikipedia.org/wiki/GlusterFS
You may also be able to find some white papers on the google file system (when it was still a university work).
The main problem of such distributed system is the failure detection (detect when a node crashes while writing on the file system => need to make sure there are no corruptions). There are multiple strategy, one may be to implement a journal which is protected by a distributed lock.
Another great (classical) problem is the 'split brain' problem, when the cluster is split in two groups because of a network failure (imagine a switch that is broken). Both groups 'think' that the other one is dead (they cannot communicate with it) but there is no way to make sure that the distant group is not writing data causing the data to diverge.
Hope you find what you want with all this.
Edit:
Now GFS is deprecated, redhat is using and developing 'Ceph'

Encrypt/Decrypt Small Messages in C on Microcontroller [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
What libraries exist for secure encryption in an embedded context. Not embedded linux, though. I'm talking about the simplest option, running on bare-metal with no operating system and no to get access to a filestream.
Think chips talking to each other on a printed circuit board, periodically sending like 10-byte messages.
rijndael? Is it worth the time to try to port it to something simpler?
A number of manufacturers provide examples of encryption algorithms for their processors. Here is one for the TI MSP430 processor family. I would recommend using with caution and a full investigation of the security impacts of your own implementation. Key management as always is a major problem, particularly how you keep this secure if the device is accessible by an attacker.
Other algorithms that are readily available are Twofish and Blowfish by Bruce Schneier.
You can also use a standard hash on a shared key plus some message varying data known to both ends (time or message count spring to mind) to produce a "random" array of bytes that can be XORed over the message data.

Public 3270 server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I know it's not exactly the right place for such a question, but I've seen similar questions to this here, and I don't know any other place where I could ask this, so sorry in advance.
Do you know where I could find a public 3270 server ? I'm working on a telnet emulator and I need one of these servers to test it.
Thanks for your help !
The biggest issue you will face, is not the TELNET/TN3270 part itself, but rather interpreting the 3270 data stream. Anyway, here are some options for you:
efglobe.com provides a public access z/OS system for personal use only. Ask them
on their forum about the kind of testing you intend to perform, to see whether they are
okay with it.
With MVS Turnkey, you can install MVS 3.8J (for which IBM apparently does not
claim copyright) under Hercules emulation. This dates to 1981, so likely lacks newer
protocol innovations since then, but could help you get the basics of the 3270 protocol
right. (MVS 3.8J lacks a TCP/IP stack, so it doesn't directly support TN3270, but
Hercules accepts TN3270 connections and makes them appear as a physical 3270 to MVS.)
IBM will sell you a mainframe emulator running latest IBM mainframe operating
systems on x86 hardware. It will cost you several thousand dollars a year though.
Many institutions used to offer public TN3270 access to library catalogues, but as most libraries have moved off the mainframe, most or all of those seem to have disappeared. In any case, using someone else's system for testing without their knowledge/permission could be ethically and/or legally questionable. You'll still find various organizations have non-public 3270 systems exposed to the Internet, but you won't get past the login screen, and the same comment about legality/ethics applies.

Efficient network server design examples, written in C [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am interested in learning how to write extremely efficient network server software and I don't mind getting my hands dirty with pointers, sockets and threading. I'm talking a server being able to handle thousands of concurrent connections. There is not much processing for each client, but a little.
Do you know of any code examples for really efficient network servers?
Optionally points for small, well documented code that is cross-platform as well.
You'll find a lot of good references and discussion about building highly scalable network servers on Dan Kegel's The C10K problem page.
Have a look at nginx, lighttpd and varnish for some popular high performance http servers.
BTW, I am currently working on combining edge-triggered epoll with multithreading (plus user-level swapcontext-style threads/fibers) - see http://svn.cmeerw.net/src/nginetd/trunk/ for some work-in-progress code (although this one is written in C++).
This may not be exactly what you are looking for, but I briefly recall looking at Space Tyrant a few years back and thinking it sounded cool.
http://librenix.com/?inode=6240
Hope it helps!
Read this
http://www.evanmiller.org/lxr/http/source/
an ldap-server handles lots of transactions per second
http://de.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol
ACE is a wise choice.

Resources