Tuesday, September 16, 2014
Wednesday, September 10, 2014
Use single regular file as a filesystem
Why? it can be for portable,virtual,develop,audit,test,free,... nice things.
make a empty regular file
dd if=/dev/zero of=myExt4.img bs=4K count=1000
check if loop device available on your system:
ls /dev/loop*
if there is no loop device, need to load kernel modules, or even compile loop module:
(Linux 3.16.1)
make menuconfig
Device Drivers -> Block Devices -> Loopback device support
make -j4
make modules_install
modprobe loop
ls /dev/loop*
use loop device
losetup /dev/loop0 myExt4.img
mkfs.ext4 /dev/loop0
mount /dev/loop0 /mnt
echo "world">/mnt/hello
df
umount /mnt
done.
ADD:
use modprobe loop max_part=31
and fdisk /dev/loop0
mkfs /dev/loop0p1
to work on virtual multi-partition disk.
Load your OS kernel by Grub2 in a single file.
BIOS loads MBR in 512 bytes into memory 0000h:7c00h
But grub2 can load a whole file into memory 0000h:7c00h,(with a patch)
that means you can write your hobbist OS in one single file.
In this way, maybe other existing OS can be loaded easily.
in grub1 there is command "kernel=file" but I cannot find it in grub2.
grub2 has command linux16, but has other restriction about the format.
grub2 also provides command multiboot, but also spec condition should be met.
The method mentioned here, need only one condition is, the last 2 bytes of first 512 bytes
should be hex 55AA.
and the kernel file could be put in any existing filesystem can be recognized by grub2.
eg:
menuentry 'NEOS on vfat' {
insmod chain
insmod fat
set root='hd0,msdos4'
chainloader /neoskern
}
or:
menuentry 'NEOS on ext4' {
insmod part_msdos
insmod chain
insmod ext2
set root='hd0,msdos7'
chainloader /boot/neoskern
}
the patch info is here: http://savannah.gnu.org/bugs/?43184
Monday, September 1, 2014
8192cu on linux 3.16.1
It is said that 8192cu wifi driver is buggy.
I download driver from the maker site RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911
cannot compile because /proc API is changed since 3.10
I found patched versions on the net, they just make the /proc part dummy.
and I see interface wlan1(or wlan0 on yours). but no wireless extension using iwconfig. and Unsupported driver 'nl80211'. and ioctl[SIOCSIWMODE]: Operation not supported if use -DWext.
At last I found kernel modules for it is just not compiled(I used self-compiled kernel). And I tried default rtl8192cu module of kernel.
It worked.
I just don't know the reason.
But I learned to try kernel drivers.
I download driver from the maker site RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911
cannot compile because /proc API is changed since 3.10
I found patched versions on the net, they just make the /proc part dummy.
and I see interface wlan1(or wlan0 on yours). but no wireless extension using iwconfig. and Unsupported driver 'nl80211'. and ioctl[SIOCSIWMODE]: Operation not supported if use -DWext.
At last I found kernel modules for it is just not compiled(I used self-compiled kernel). And I tried default rtl8192cu module of kernel.
It worked.
I just don't know the reason.
But I learned to try kernel drivers.
Subscribe to:
Comments (Atom)