How to mount preallocated ISO image in RAM [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have an ISO image (stock Ubuntu 13.10 DVD ISO image) loaded into memory pre-OS and I'm trying to start the Linux installation process from this image. GRUB can recognize the image as a cd and I can start the installation (I'm experimenting with an UEFI platform, and using an UEFI version of GRUB so it can recognize the image as a valid block device with a supported file system).
My problem is the kernel cannot find the install media (which is expected) so it panics early on. I realize I can write a simple block device driver so the kernel can find the image but for the sake of portability, is there a way to mount tmpfs/ramfs at a specific start address? Or is there a way to tell the kernel that there is a file system at a specific address?
Thanks

Compile your kernel with the ISO filesystem as a built-in. Specify the ISO image as the initrd image. The contents of the ISO will probably need modified to understand this new way of booting as, unlike a normal initrd image, you will not want to be unmounting it to mount the real root filesystem.
Note that the preferred way would probably be to write a kernel module that recognizes and mounts the ISO and put it in a smaller initramfs image instead. The above is just an idea about how you might accomplish it without writing a module.

Related

How to create a ISO file from a bootloader on windows 10 64bit [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I want to write a simple OS from scratch. I found a tutorial that i want to use. One of the requirements for a setup is VFD, but VFD does not work on 64bit systems. So im now trying to find supstitutions. My one thought was to maybe try to make the code and stuff into an iso file and mount it in virtualBox, but i dont know how to make an iso file.
How do i create an iso file from sourcecode or is there a way to get VFD or equivalent wokring on 64bit windows?
I think you can create a binary file using nasm and load it as a floppy device from virtual box.
Alternatively, you can load the binary image from qemu...(at least on Linux)
I'm not an expert, but I think it should work.
I got the solution. DD for windows and imdisk.
dd if=bootloader.bin of=bootloader.flp
imdisk -a -m A: -f bootloader.flp -s 1440K

How do I put Yocto-generated image on a hard drive and boot it? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have run bitbake core-image-minimal-dev properly configured for a genericx86 machine. BitBake generates a bootia32.efi, a bzImage--<stuff>.bin, an .hddimg, an .iso, a .rootfs.ext3, a .rootfs.ext4, a .rootfs.tar.bz2, and a core-image-initramfs-<stuff>.rootfs.cpio.gz. I'm interested in a method of how to dd one or more of these onto the hard disk of my target machine and boot from that hard disk.
dd if=path/to/imagefile/imagename.hddimg of=/dev/usbdevicename
You'll find the correct usb device name e.g. by plugging in the usb disk and looking at dmesg|tail output -- do not guess as mistakes will be fatal to your hard disk. A practical example from my build machine:
sudo dd if=tmp/deploy/images/intel-corei7-64/core-image-sato-intel-corei7-64.hddimg \
of=/dev/sdb \
bs=4096
Note that you probably want to use intel-corei7-64 as the machine unless you know that genericx86 is correct for your hardware: despite the name former is the common Intel BSP for anything that's not ancient (that includes big Cores, Xeons, Atoms ...).
How to boot the image depends on your target device: you may need to go to BIOS settings to select "boot from USB".

I'm locked out of my python program, Linux operating system, after auto start-up employed [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm using a small Linux computer in which the software is on an sd card. I needed a program to run at start-up, so I did sudo nano /etc/rc.local and then I added a new line btwn F1 and exit 0 that contains the complete path to my program. This works great, but now I'm locked out. My program runs at start-up like I wanted, but I need to access the program and tweak a few things. I did try putting the sd card in my desktop Windows computer and add init=/bin/sh to the end of the cmdline.txt file. But this had no effect, any suggestions?
Presumably, boot up a desktop Linux machine - mount the sd card, edit the /mnt/etc/rc.local to remove the newline and complete path to your program (from between F1 and exit 0). Then umount the sd card and boot it up. If it won't boot, try and undo that edit to cmdline.txt (which I don't think actually does anything - being a txt file).
This question probably belongs on Super User rather than here.
However, it would probably be easiest for you to get access to a Linux PC and try to edit the file there rather than on the embedded board itself.

How does bootloader(e.g. grub,lilo... ) find kernel image? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
For example, if use grub to boot system, there may be lines such as
root (hd0,6)
kernel /boot/vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/
initrd /boot/initrd-2.6.11-1.1369_FC4.img
in menu.lst.
My question is:
before the kernel image is loaded into memory, I think no file system info(such as file system type, super block) which can be used to locate the kernel image in the disk exist.
So how does bootloader know the CHS of the image in the disk?
I guess that bootloader could find the super block according to "root (hd0,6)"; if so, it must blindly detect all the possible file systems and find a matching one. Is it too complicated?
I am gonna give you an answer using Lilo like example:
The reason that you have to run /sbin/lilo after installing a new
kernel is that the LILO bootloader doesn't understand file systems it
only knows about the lower level block structure of the disk. The
/sbin/lilo program does understand file systems, and translates the
kernel's path (i.e "/boot/vmlinuz-2.6.3") into a logical block address
ie 3-4-123) so that the LILO bootloader can find the kernel image to
load. Effectively, this is a big hack.
Source:
http://courses.cs.washington.edu/courses/cse451/02wi/section/bootloaders.txt
The setup process for GRUB includes generation of
full list of physical addresses of stage 2 file
encoded drive number (as used with BIOS calls)
encoded partition number (these two forms value represented as (hd0,6) from your example)
Stage 1 and bootstrapper of stage 2 can together use this to load full stage 2 into memory. Since that moment, stage 2 can detect FS type, activate respective read-only FS driver, read runtime config (grub.cfg or menu.lst) and proceed with following reading of kernel, initrd, etc. using FS driver.
NB this principally differs from LILO that the latter hardcodes kernel and initrd sector lists during loader installing; when booted, loader knows only sector lists but not FS structure.

Install two ceentOS on the same harddrive [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about programming within the scope defined in the help center.
Improve this question
I want to install two centOS V6.2 on the same Hardidsk but on different partition. After installing on different different partition, at the time of booting it shows only centOS which is installed at last.
Can some help me to install two centOS on the same Harddrive.
I assume that you are using GRUB. Bootup with whatever CentOS that boots up. Open the grub.conf file (normally under /boot/grub). Find the kernel and initramfs of the other installation of CentOS.(usually under /boot)
Copy the title, root, kernel and initrd lines in grub.conf file, and paste those lines after the existing ones. Make changes to the newly pasted lines. Change the title to reflect the text in the new menu. Change root to the / of the other installation partition in GRUB terms. Change the kernel and initrd params to reflect the location of other kernel and initramfs.
Delete the line 'hiddenmenu' and increase the timeout to display GRUB menu properly. Save the changes and reboot.

Resources