dslreports logo
uniqs
1

benyto
Premium Member
join:2000-07-09
Chico, CA

benyto to ihaddsl

Premium Member

to ihaddsl

Re: Setting HDD Serial Number in Mandrake

I'm wondering if shwasasin is referring to a serial number like DOS/Windows assigns to a partition upon creation. Because I've never had a need for such information, I'm not sure is such a property exists in the common Linux filesystems.

hdparm will return a serial number on IDE devices. Because that information is obtained from the hardware itself, I'm guessing that is a read-only parameter.
ihaddsl
join:2001-12-05
/dev/hda0

ihaddsl

Member

You could well be right on the serial number reference.

hdparm in fact uses HDIO_GET_IDENTITY, so the mechanism is the same.
shwasasin
join:2002-02-28
Newmarket, ON

shwasasin to benyto

Member

to benyto
The company I work for is in the process of rewriting our entire embedded software for Linux. We set the Hard Drive serial number to the unit serial number so customers cannot swap stickers to screw with out warranties. We have pascal code for dos that did this, but going from pascal in dos to c++ in linux is a big jump.
ihaddsl
join:2001-12-05
/dev/hda0

ihaddsl

Member

Well, if you know how to set the serial number using low level functions, you can probably gain direct access to the hardware yourself under linux and use the same mechanisms, although you may have to do some of this in kernel space, I'm not really sure.
shwasasin
join:2002-02-28
Newmarket, ON

shwasasin

Member

That's where it gets tricky. I can't use any open source (i.e. the kernel) because the project is closed-source (not my choice) and we are trying to avoid any GPL violations.

graysonf
MVM
join:1999-07-16
Fort Lauderdale, FL

graysonf to shwasasin

MVM

to shwasasin
There are Pascal compilers for Linux. Any reason you can't create an executable that way, or compile the code as an object module and link it in later with the C++ stuff?
shwasasin
join:2002-02-28
Newmarket, ON

shwasasin

Member

Well as far as I understood it, the code we use to set the serial number uses int 21 (dos software interupts). However I will look into it, thanks for your help!
ihaddsl
join:2001-12-05
/dev/hda0

ihaddsl to shwasasin

Member

to shwasasin
said by shwasasin:
That's where it gets tricky. I can't use any open source (i.e. the kernel) because the project is closed-source (not my choice) and we are trying to avoid any GPL violations.

It looks like you might be able to use userspace to do this

check this out

»www.linux.org/docs/ldp/h ··· O-2.html
you might find it useful