Extract System's register's value by usiong 'C' language
-
Dear sir, I want to retrieve the value of Registers of operating systems by using C language.
-
Dear sir, I want to retrieve the value of Registers of operating systems by using C language.
Hi, The first bad news is that operating systems don't have registers, the processor does. Secondly there's no portable way of reading them in C - it's processor and compiler dependent, if you can do it at all. Just out of interest, is there any particular reason you want to do this as most of the things you read will be completely meaningless in the wider operating system context? Cheers, Ash
-
Dear sir, I want to retrieve the value of Registers of operating systems by using C language.
I do not think you can access the registers directly in C (in C++ use the
__asm
keyword). However, even if you could address them their content will be meaningless beyond containing a few variables local to your function. Perhaps you could clarify what you are trying to achieve.It's time for a new signature.
-
Hi, The first bad news is that operating systems don't have registers, the processor does. Secondly there's no portable way of reading them in C - it's processor and compiler dependent, if you can do it at all. Just out of interest, is there any particular reason you want to do this as most of the things you read will be completely meaningless in the wider operating system context? Cheers, Ash
Hi! Thanks for giving interest in my problem. Acctually I have an pripherial device(MS-DOS) based;I want to retrieve their SerialNumber or any internal information. Ex. We can retrieve the Motherboard number by using getipaddress();
-
Hi, The first bad news is that operating systems don't have registers, the processor does. Secondly there's no portable way of reading them in C - it's processor and compiler dependent, if you can do it at all. Just out of interest, is there any particular reason you want to do this as most of the things you read will be completely meaningless in the wider operating system context? Cheers, Ash
I m sorry;Getipaddress is used for IP Address;also we can retrieve the Motherboard number.
-
I do not think you can access the registers directly in C (in C++ use the
__asm
keyword). However, even if you could address them their content will be meaningless beyond containing a few variables local to your function. Perhaps you could clarify what you are trying to achieve.It's time for a new signature.
I like clear my problem with explanation. **EX:**If i used the Usb Drive(pen Drive)to my computer system; I want to extract the Serial Number or any Internal information from the memory of the USB. If u have any idea plz tell me.
-
Hi, The first bad news is that operating systems don't have registers, the processor does. Secondly there's no portable way of reading them in C - it's processor and compiler dependent, if you can do it at all. Just out of interest, is there any particular reason you want to do this as most of the things you read will be completely meaningless in the wider operating system context? Cheers, Ash
I like to clear my problem with explanation. EX:If i used the Usb Drive(pen Drive)to my computer system; I want to extract the Serial Number or any Internal information from the memory of the USB. If u have any idea plz tell me.
-
I like to clear my problem with explanation. EX:If i used the Usb Drive(pen Drive)to my computer system; I want to extract the Serial Number or any Internal information from the memory of the USB. If u have any idea plz tell me.
Ah, okay. Despite working for a harddisk manufacturer I've never dug around in USB. If you're using Windows then http://www.emmet-gray.com/Articles/USB_SerialNumbers.htm[^] seems to have all the recipes you'd need to grab the serial number from a USB 2.0 device. One problem is that the code is written in VB, but it gives the sequence of Win32 calls you'd need to make to get the information (and it's a bit convoluted - hopefully someone more in the know can point you at a simpler method). If you're using another OS then there's probably a similar recipe out there somewhere. Another alternative would be to write a device driver and tickle the device directly through it's I/O ports and see how it giggles. However you'll need to know more than most mortals should need to know about USB - and having seen a colleague of mine go bald reading the OHCI, UHCI and EHCI specs I wouldn't wish that on anyone. Cheers, Ash PS: Perhaps posting another question with "Reading configuration data (e.g. serial number) from a USB device" might attract someone who knows what they're talking about.
-
Ah, okay. Despite working for a harddisk manufacturer I've never dug around in USB. If you're using Windows then http://www.emmet-gray.com/Articles/USB_SerialNumbers.htm[^] seems to have all the recipes you'd need to grab the serial number from a USB 2.0 device. One problem is that the code is written in VB, but it gives the sequence of Win32 calls you'd need to make to get the information (and it's a bit convoluted - hopefully someone more in the know can point you at a simpler method). If you're using another OS then there's probably a similar recipe out there somewhere. Another alternative would be to write a device driver and tickle the device directly through it's I/O ports and see how it giggles. However you'll need to know more than most mortals should need to know about USB - and having seen a colleague of mine go bald reading the OHCI, UHCI and EHCI specs I wouldn't wish that on anyone. Cheers, Ash PS: Perhaps posting another question with "Reading configuration data (e.g. serial number) from a USB device" might attract someone who knows what they're talking about.
Thanks for this response; But actually have an other Electronics device Ms-DOS based, Please clerify how to retrieve the information any system which can communicate with Computer System.
-
Thanks for this response; But actually have an other Electronics device Ms-DOS based, Please clerify how to retrieve the information any system which can communicate with Computer System.
-
I'm not sure what you mean by a device being MS-DOS based. If you can expand that a bit I might be able to point you somewhere to help. Cheers, Ash
Hi, ok ,I have an CMRI is an Energy Meter Reading Device; I want to know the serial no. of CMRI;which is unique & provided by the manufacturer. CMRI is Ms-Dos based device. PLz help me
-
Hi, ok ,I have an CMRI is an Energy Meter Reading Device; I want to know the serial no. of CMRI;which is unique & provided by the manufacturer. CMRI is Ms-Dos based device. PLz help me
Seems to me that the manufacturer of the device would have provided such with their API.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Hi, ok ,I have an CMRI is an Energy Meter Reading Device; I want to know the serial no. of CMRI;which is unique & provided by the manufacturer. CMRI is Ms-Dos based device. PLz help me
-
Hi, ok ,I have an CMRI is an Energy Meter Reading Device; I want to know the serial no. of CMRI;which is unique & provided by the manufacturer. CMRI is Ms-Dos based device. PLz help me
Just done a bit of digging... Okay, looks like CRMI devices are used to read 'leccy and gas meters. They seem to have RS232 or USB interfaces on them and usually come with a suite of tools through which you can connect the CRMI to a host computer. These CRMI things seem to run something that looks like PC-DOS or MS-DOS but that's a complete red herring, it has no bearing on getting data off the device. Now if the device has a USB port and follows the USB 2.0 specification then the link I dropped in an earlier post will show you the sequence of function calls you need to make to get the device's serial number. From what I've read the USB capable ones are just USB mass storage devices and look like any other disk drive when they plug in. If you want the data on the device you can then just use ordinary C standard library function calls to open the files on it. Cheers, Ash