SysRq, The magic key
This key is rather useful for linux kernel developers, it enable you to communicate with the kernel regardless of what else it is doing.
This key can be enabled via the CONFIG_MAGIC_SYSRQ (Kernel hacking –> Magic SysRq key), and you need to turn on this option with below command:
echo 1 > /proc/sys/kernel/sysrq
Key Command Description
SysRq-b Reboot the machine.
SysRq-e Send a SIGTERM to all processes except init.
SysRq-h Display SysRq help on the console.
SysRq-i Send a SIGKILL to all processes except init.
SysRq-k Secure Access Key: Kill all programs on this console.
SysRq-l Send a SIGKILL to all processes including init.
SysRq-m Dump memory information to console.
SysRq-o Shutdown the machine.
SysRq-p Dump register to console.
SysRq-r Turn off keyboard raw mode.
SysRq-s Sync all mounted file systems to disk.
SysRq-t Dump task information to console.
SysRq-u Unmount all mounted file systems.
VFS: cannot open root device “hda” or unknown-block(0,0)
If you compiled the Linux kernel and when you boot your new image, appeared following problem:
VFS: Cannot open root device “hda” or unknown-block(0,0)
Please append a correct “root=” boot option; here are the available partitions
Kernel panic
This problem is caused by fault initrd.img file or any problem in it, because when kernel start its boot, it need some drivers that are provided by initrd.img file, such as filesystem, block devices, IDE devices, so the Linux need this file to start correctly.
A way that I find to solve this problem was to set (File System, Devices Drivers –> Block Devices, Devices Drivers –> ATA/ATAPI/MFM/RLL support) like as default .config generated by make defconfig command. In this file, the essential drivers (showed up) are configured like as [y] (built-in) not [m]. Pictures with these configurations are showed below:
Devices Drivers –> Block Devices

Devices Drivers –> ATA/ATAPI/MFM/RLL support
When I was look for solution to this problem, I saw in some foruns that people had the same problem but it happened in grub bootloader, and they got a solution changing the configuration file of grub. So case you followed the steps above that I described, can be a grub configuration problem.
/dev/input/mice don’t appear
I have configured and emulated on qemu the Debian Etch without graphic interface, but after I needed to install xserver-xorg application to make some tests with mplayer.
Thus after I had executed apt-get install xserver-xorg, I tested X server but it couldn’t find the mouse corepointer, finishing with error below:
(EE) Cannot open device /dev/input/mice no such file or directory
(EE) Configured mouse: Cannot open input device
(EE) PreInit failed for input device “Configured Mouse”
Fatal server error:Failed to initialize core device
Really, when I checked mouse’s entry into /dev/input, there wasn’t a /dev/input entry.
I solved this problem with following steps:
First check if module to your mouse has been configured on kernel.
devices drivers -> input devices -> mouse
cat /sys/class/input/mice/uevent: Here you should look for major and minor number. Sometimes can be written the same as below:
13:63 where 13 is major number and 63 is minor number.
Now you may to create a new entry to mouse into /dev:
mkdir /dev/input: Creates a directory just to input devices, first verify that it there isn’t.
mknod /dev/input/mice c 13 63: Creates mouse’s entry into /dev/input/. The third parameter is ‘c, because mouse is a character device.
The mknod’s parameters is mknod <entry’s name> <device kind> <major number> <minor number>
If you want to test your mouse now execute following command:
cat /dev/input/mice: Shake your mouse and check if showed up some charactere garbage on your monitor. Case true, your mouse is working correctly.
Finally, execute again your X server.
Make, how use it in kernel’s compiling.
When you need to compile the linux kernel, you certally must use make command. In this post I will describe some ways how use it to compile linux.
First you need have a version of linux, you can find it in http://www.kernel.org. So choice a version and download.
make clean: To remove all objects generated in previous compiling.
make mproper: Besides to remove all objects (make clean), remove the .config file too.
make dep: Solves dependences, it should be used after you have configured your kenrel.
make defconfig: Generates a default .config
make allyesconfig: Set all fields in .config as [y]
make allnoconfig: Doesn’t set any field in .config
make allmodconfig: Sets all options like as [m] (module) in .config file.
make randconfig: Generates a new kernel configuration with randow answers to all differents options.
make menuconfig: Opens a graphic interface to user to configure the .config file. Here you need install ncurses libraries.
make bzImage: Generates a linux image which you can make boot with any bootloader.
make modules: Compiles linux modules that you have configured in .config file.
make module_install: Uses this command to install the kernel modules into the directory path:
/lib/modules/<KERNELVERSION>/kernel/drivers(Makefile)
You can to define a new directory root which to install the modules following the command below:
make module_install INSTALL_MOD_PATH=<chosen directory>
These commands described above must be executed into linux kernel directory. Because the make command need a target file (Makefile).
Recuperando o Xorg no Ubuntu
Muitas vezes quando é feita a atualização de uma distribuição, ocorrem modificações que podem comprometer o bom funcionamento do servidor X (Xorg ou Xfree),
como por exemplo a não inicialização do gerenciador de login (Gdm). Então aki vai uma forma bem simples de restaurar o seu servidor X. Neste caso explicarei como
restaurar o servidor Xorg.
Este tutorial pode ser utilizado para as distro ubuntu e debian, as outras eu não testei então não posso falar, mas creio q seja bem parecido
execute como root:
# /etc/init.d/gdm stop // para fechar a nossa interface gráfica, que está mau configurada.
# Xorg -configure // este comando irá gerar um arquivo xorg.conf.new genérico para o seu sistema.
# X -config xorg.conf.new // para verificar se esse arquivo gerado está funcionando corretamente, ele tem que gerar uma tela cinza com um “X” como cursor do mouse.
# cp xorg.conf.new /etc/X11/xorg.conf // configurar o novo arquivo gerado, para ser usado pelo nosso servidor X em questão o Xorg
# /etc/init.d/gdm start // iniciar o nosso gerenciador de login.
Recuperando o grub com o live CD do Ubuntu
Caso vc tenha instalado alguma das variantes do Windows (2000,XP,Vista,etc) em um PC que já tenha alguma distro Linux instalada, vc certamente perderá o grub, pois ao fazer a instalação, o Windows apaga oq estiver na MBR (primeiros 512Mb do disco, usados para instalar os bootloaders) para colocar seu bootloader. Consequenmente o bootloader(grub) do linux desaparecerá na hora da inicialização.
Para resolver este problema no Ubuntu, dê boot com o live CD e com o shell aberto execute os seguintes comandos:
$ sudo grub install /dev/hda //comando vai abrir o prompt do grub com a partição passada como parametro.
- o caminho do seu dispositivo de bloco pode mudar podendo ser /dev/hdb por exemplo (o formato geral é /dev/hdx onde x representa a posição do disco), para saber o certo de cfdisk ou fdisk -l e verifique o endereço correto, caso apareça sda, deixe hda mesmo.
> find /boot/grub/stage1 // irá dar uma resposta do género (hd0,1) , usem o valor que vos der
> root (hd0,1)
> setup (hd0) // instala o grub na MBR do disco setado.
> quit
Deixe um comentário
Deixe um comentário

Deixe um comentário