LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices

Reply
 
LinkBack Search this Thread
Old 11-12-2009, 02:55 AM   #1
jsjcaowei
LQ Newbie
 
Registered: Nov 2009
Posts: 10

Rep: Reputation: 0
CMOS checksum bad when do nvram restore


I am a BIOS engineer.
My linux OS is Ubuntu 9.04.
when I do the following operation , a bug occurs.


command :
# modprobe nvram
# dd of=nvram.img if=/dev/nvram
after inputting the command, I restart my notebook,and modify a option in the setup menu. Save and restart.
when entering linux, I input the following operation to restore the CMOS data :
command :
# modprobe nvram
# dd if=nvram.img of=/dev/nvram
but when I restart the notebook.
the string "CMOS checksum Bad " will display.
I know the file I have saved in the nvram.img is only 114 bytes of CMOS, but the last 128 bytes is not saved. but the option I changed in the setup menu is saved to the extended CMOS,so when I restore the nvram.img to CMOS .the cehcksum is not equal to the earlier one.

So, I want to know why does it only saves the 114 bytes of the CMOS. And If I want to save all the 256bytes CMOS data ,what command should I use?
Thanks
 
Old 11-12-2009, 03:04 AM   #2
Coburn64
LQ Newbie
 
Registered: Jul 2009
Location: Australia
Distribution: Debian GNU/Linux 6.0 Squeeze
Posts: 27

Rep: Reputation: 16
I think that dd doesn't save checksums, thus causing the problem.

As for the 114 of 128 bytes issue, could it be that dd is only saving the used portion of the nvram? I think dd may have a switch so you can specify how much data you'd like to copy.

You could also point a hex editor to /dev/nvram and save the contents of that in a file...
 
Old 11-12-2009, 03:21 AM   #3
evo2
Senior Member
 
Registered: Jan 2009
Location: Japan
Distribution: Debian
Posts: 2,500

Rep: Reputation: 321Reputation: 321Reputation: 321Reputation: 321
Quote:
Originally Posted by jsjcaowei View Post
So, I want to know why does it only saves the 114 bytes of the CMOS. And If I want to save all the 256bytes CMOS data ,what command should I use?
Can you try
Code:
dd bs=256 count=1 if=foo of=bar
?

I'm not a dd expert.
Code:
man dd
For more info.

Cheers,

Evo2.
 
Old 11-12-2009, 03:22 AM   #4
jsjcaowei
LQ Newbie
 
Registered: Nov 2009
Posts: 10

Original Poster
Rep: Reputation: 0
thank you.
But dd command has saved the CMOS checksum.
And the command is also supplied by the customer.
beacause I don not know the content nvram.ko.
so I do not kown how to solve it.
And as most of my colleague don not kown Linux, so this bug is given to me.

Now I think if there is a command to save all the 256 bytes of CMOS.
the bug will be solved !
 
Old 11-12-2009, 03:27 AM   #5
jsjcaowei
LQ Newbie
 
Registered: Nov 2009
Posts: 10

Original Poster
Rep: Reputation: 0
dear evo2:
thank you.
But your idea will not help to this bug.
the command : modprobe nvram
only copy the 114 bytes of all the 256 bytes.
. So we can not dd more bytes!!

Last edited by jsjcaowei; 11-12-2009 at 03:32 AM.
 
Old 11-12-2009, 03:37 AM   #6
evo2
Senior Member
 
Registered: Jan 2009
Location: Japan
Distribution: Debian
Posts: 2,500

Rep: Reputation: 321Reputation: 321Reputation: 321Reputation: 321
Ok, I'm a bit confused now. We have four differnt numbers floating around here: 114, 144, 128 and 256.

At one point your say:
Quote:
I know the file I have saved in the nvram.img is only 114 bytes of CMOS, but the last 128 bytes is not saved.
So it should be 114+128=242 ?

You also say:
Quote:
Now I think if there is a command to save all the 256 bytes of CMOS
Isn't that what "dd bs=256 count=1 if=foo of=bar" would do?

I'm quite sure your problem can be solved by passing the correct options to dd, but I don't fully understand what you are trying to, and as such can't tell you what the flags are. You can probably work out the options yourself by reading the man page.

Evo2.
 
Old 11-12-2009, 04:01 AM   #7
jsjcaowei
LQ Newbie
 
Registered: Nov 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Dear evo2:
sorry >
my explaination maybe is not clear.
as the CMOS is all 256 Bytes!
it is divieded into 2 part as every part has 128 byte.

the first 128 bytes CMOS is called standard CMOS and the second 128 bytes is called extended CMOS.
Here when we excute the command : modprobe nvram.
114 bytes will be automatically saved to nvram. The 114 bytes is from offeset 0x0D to 0xFF of starded CMOS.

But why does the customer use the command to save CMOS data, I am really confused. And when We use the command :modprobe nvram. why does it only save the 114 bytes, I also do not kown. Because it may be done by nvram.ko or other drivers of Ubuntu.

So ,if there is a commnd to save all the 256 bytes CMOS. I predict my bug wll be solved.
that is all.
thsnk you!!

Last edited by jsjcaowei; 11-12-2009 at 04:03 AM.
 
Old 11-12-2009, 04:48 AM   #8
evo2
Senior Member
 
Registered: Jan 2009
Location: Japan
Distribution: Debian
Posts: 2,500

Rep: Reputation: 321Reputation: 321Reputation: 321Reputation: 321
Ok, I'm not a bios developer, so although you may have explained something there is every chance I have missunderstood. :-)

Quote:
Originally Posted by jsjcaowei View Post
Dear evo2:
sorry >
my explaination maybe is not clear.
as the CMOS is all 256 Bytes!
it is divieded into 2 part as every part has 128 byte.

the first 128 bytes CMOS is called standard CMOS and the second 128 bytes is called extended CMOS.
Here when we excute the command : modprobe nvram.
114 bytes will be automatically saved to nvram. The 114 bytes is from offeset 0x0D to 0xFF of starded CMOS.
Ok, so when you load the nvram kernel module (modprobe nvram) it is supposed to write 256 bytes to /dev/nvram. However, when you try to read from /dev/nvram there are only 114 bytes.

Ok, I just had a look at the source, nvram.c and seems that 114 bytes is what is expected.
Quote:
But why does the customer use the command to save CMOS data, I am really confused. And when We use the command :modprobe nvram. why does it only save the 114 bytes, I also do not kown. Because it may be done by nvram.ko or other drivers of Ubuntu.
Why don't you ask your customer these questions?

Quote:
So ,if there is a commnd to save all the 256 bytes CMOS. I predict my bug wll be solved.
that is all.
thsnk you!!
There probably, is, finding it is the problem.

Good luck.

Evo2.
 
Old 11-12-2009, 05:26 AM   #9
jsjcaowei
LQ Newbie
 
Registered: Nov 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Dear evo2:
thank you very much. I will check and see the source.
Then I will discuss with my leader to solve the bug .
thanks!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
*HELP* CMOS/GPNV Checksum Bad Acemack Linux - General 2 05-14-2006 09:43 PM
CMOS/GPNV Checksum Bad allelopath Linux - General 3 08-27-2005 11:34 PM
CMOS checksum error? slackwarefan Slackware 13 09-16-2004 01:58 PM
CMOS checksum error and spontaneous reboots frieza Linux - Hardware 7 06-30-2004 03:49 PM
Problem after install RH9.0 / CMOS checksum/ johny007 Linux - Software 4 07-25-2003 02:56 AM


All times are GMT -5. The time now is 02:53 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration