我有一台戴尔电脑,每次启动时都会出现非常丑陋和倒霉的外星人脸。我想更改它或永久禁用它,但在 Bios 中他们没有任何选项。
我怎样才能从现在运行的 Linux Fedora 或 ArchLinux 中更改这一点?
尝试以下方法无效。(http://www.pixelbeat.org/docs/bios/)
./flashrom -r firmware.old #save current flash ROM just in case
./flashrom -wv firmware.new #write and verify new flash ROM image
还尝试过:
$ cat cc
#include <stdio.h>
#include <inttypes.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define lengthof(x) (sizeof(x)/sizeof(x[0]))
uint16_t checksum(const uint8_t* data, int len)
{
uint16_t sum = 0;
int i;
for (i=0; i<len; i++)
sum+=*(data+i);
return htons(sum);
}
void usage(void)
{
fprintf(stderr,"Usage: therm_limit [0,50,53,56,60,63,66,70]\n");
fprintf(stderr,"Report therm limit of terminal in BIOS\n");
fprintf(stderr,"If temp specifed, it is changed if required.\n");
exit(EXIT_FAILURE);
}
#define CHKSUM_START 51
#define CHKSUM_END 109
#define THERM_OFFSET 67
#define THERM_SHIFT 0
#define THERM_MASK (0x7 << THERM_SHIFT)
#define THERM_OFF 0
uint8_t thermal_limits[]={0,50,53,56,60,63,66,70};
#define THERM_MAX (lengthof(thermal_limits)-1)
#define DEV_NVRAM "/dev/nvram"
#define NVRAM_MAX 114
uint8_t nvram[NVRAM_MAX];
int main(int argc, char* argv[])
{
int therm_request = -1;
if (argc>2) usage();
if (argc==2) {
if (*argv[1]=='-') usage();
therm_request=atoi(argv[1]);
int i;
for (i=0; i<lengthof(thermal_limits); i++)
if (thermal_limits[i]==therm_request)
break;
if (i==lengthof(thermal_limits))
usage();
else
therm_request=i;
}
int fd_nvram=open(DEV_NVRAM, O_RDWR);
if (fd_nvram < 0) {
fprintf(stderr,"Error opening %s [%m]\n", DEV_NVRAM);
exit(EXIT_FAILURE);
}
if (read(fd_nvram, nvram, sizeof(nvram))==-1) {
fprintf(stderr,"Error reading %s [%m]\n", DEV_NVRAM);
close(fd_nvram);
exit(EXIT_FAILURE);
}
uint16_t chksum = *(uint16_t*)(nvram+CHKSUM_END);
printf("%04X\n",chksum); exit(0);
if (chksum == checksum(nvram+CHKSUM_START, CHKSUM_END-CHKSUM_START)) {
uint8_t therm_byte = *(uint16_t*)(nvram+THERM_OFFSET);
uint8_t therm_status=(therm_byte & THERM_MASK) >> THERM_SHIFT;
printf("Current thermal limit: %d°C\n", thermal_limits[therm_status]);
if (
(therm_status == therm_request)
) therm_request=-1;
if (therm_request != -1) {
if (therm_status != therm_request)
printf("Setting thermal limit to %d°C\n", thermal_limits[therm_request]);
uint8_t new_therm_byte = (therm_byte & ~THERM_MASK) | (therm_request << THERM_SHIFT);
*(uint8_t*)(nvram+THERM_OFFSET) = new_therm_byte;
*(uint16_t*)(nvram+CHKSUM_END) = checksum(nvram+CHKSUM_START, CHKSUM_END-CHKSUM_START);
(void) lseek(fd_nvram,0,SEEK_SET);
if (write(fd_nvram, nvram, sizeof(nvram))!=sizeof(nvram)) {
fprintf(stderr,"Error writing %s [%m]\n", DEV_NVRAM);
close(fd_nvram);
exit(EXIT_FAILURE);
}
}
} else {
fprintf(stderr,"checksum failed. Aborting\n");
close(fd_nvram);
exit(EXIT_FAILURE);
}
return EXIT_SUCCESS;
}
$ gcc c.c -o bios
# ./bios
16DB
答案1
您发布的代码与更改 BIOS 启动画面完全无关(它用于更改特定 BIOS 中的热重启设置)。事实上,除了它所针对的特定 BIOS 之外,其他任何事情都会让你的机器非常不开心。
通常,只有硬件提供商为您提供了更改 BIOS 启动映像的方法,您才能这样做。我知道我购买的许多主板都附带一个实用程序,该实用程序会获取 BIOS 映像文件和您选择的映像,然后生成一个新的 BIOS 映像,然后您可以像往常一样刷新它。但这通常是由 OEM 提供的。
答案2
您可能能够使用 Dell 的 Command|Configure 实用程序来实现此目的,但我不确定。每次我尝试使用它时,我的系统都会崩溃。 http://en.community.dell.com/techcenter/enterprise-client/w/wiki/7532.dell-command-configure/
曾经有一个实用程序可以帮助您在戴尔系统上执行此操作(不确定是戴尔发布的还是其他人发布的)但我再也找不到任何好的链接了。