OSDev: Windows 7 'copy' command won't copy to b:\ from ImDisk - build

I have a .bat (Batch) file compiling an OS I am making in Windows 7. I use nasm to compile the code, then dd and imdisk. Although probably not worth mentioning, after compilation I use mkisofs to make a .iso then VirtualBox for testing.
When it gets past "Copying kernel and files to disk" it (the output in the prompt) says The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted. 0 file(s) copied.
It compiled before in which I could properly test the OS and some text would appear, then I noticed nothing appeared on the screen anymore, so I further looked at the prompt output and batch file and realized this.
Can anyone give me some help here? I really want it to compile.
Here is the main part that errors in my batch file:
echo Adding boot to disk
cd build
dd if=..\src\boot\boot.bin bs=512 of=myos.flp
cd ..
echo Mounting disk image
imdisk -a -f build\myos.flp -s 1440K -m B:
echo Copying kernel and files to disk
copy src\kernel.bin b:\
echo Dismounting disk image
imdisk -D -m B:
I am able to successfully compile MikeOS (my inspiration) with pretty much the same commands (I modified the MikeOS buildwin.bat to use dd), so I have no idea what is happening.
EDIT: I even tried this in Ubuntu with dd and it doesn't work! When I get to the mount part it says something about the filesystem...I think my dd command is wrong, but for some reason I can compile MikeOS correctly. Ugh.

The boot file should always be in the first sector. Try this:
dd seek=0 if=..\src\boot\boot.bin bs=512 of=myos.flp
seek=0 copies the boot file to the first sector. If you don't put it, the dd command may copy the file to somewhere else.

Related

Multipass log (multipassd.log) bloating disk

My multipassd.log had grown to 200+ GB before i noticed (because my disk was full). Stupid as i was i deleted the log with rm -rf multipassd.log (file was so big i couldn't open it). This apparently deleted the file without freeing the space on disk. So now i have 200+ GB of inaccessible disk space.
The space does not show up as used when checking the file system with the du command, even from the root directory. I also downloaded DaisyDisk, which showed that there were 200 GB of "hidden files" but couldn't access or delete them, even with all privileges enabled.
Eventually I fixed it, but if anyone can explain why rm -rf multipassd.log failed to free the disk space, that would be appreciated :)
After messing around for a couple hours, I fixed it by opening Console then creating a new log file and reloading the multipass launcher daemon with
$ sudo touch /Library/Logs/Multipass/multipassd.log
$ sudo launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
$ sudo launchctl load /Library/LaunchDaemons/com.canonical.multipassd.plist
Then I started an instance of Multipass and cleared the (almost empty) log from the already opened console. That freed up the disk space :)

build failed for alcatel one touch fire

I'm trying to build B2G for alcatel one touch fire.
After cloning B2G I ran BRANCH=v2.0 ./config.sh hamachi and then on running ./build.sh I get the following:
Pulling "libOmxWmaDec.so" cp: cannot stat ‘../../../backup-hamachi/system/lib/libOmxWmaDec.so’: No such file or directory Failed to pull libOmxWmvDec.so. Giving up.
Build failed! <
Build with |./build.sh -j1| for better messages If all else fails, use |rm -rf objdir-gecko| to clobber gecko and |rm -rf out| to clobber everything else.
That is error is because you have not the proper blobs to start building the images. Those blobs are stored in ‘../../../backup-hamachi/’ and they are automatically pulled from your device.
When you try to build the image, the build.sh script automatically backups your system and pulls every lib; it will use them to build your next build.
My suggestions:
Test your USB cable, If it is too loose, it may be interrupting the backup.
Open an ADB Shell to check if "something" is closing your ADB server meanwhile.
Check if that lib exists in your device, use the ADB shell and find it.
If it exists, you can always do a backup manually using Busybox: https://wiki.mozilla.org/File:Busybox-b2g.tar.gz
If it does not exist, find a proper backup for your Hamachi.
Check the following bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1063917

AWS : cannot execute binary file

My server is a Amazon Linux AMI 64bits (2014.09-release-notes)
I compiled a program coded in C++ (gcc48-c++.x86_64 is installed) :
[root#ip-***-**-**-*** waveform_generator]# make
Compiled [src/main.cpp] >> [src/main.o]
Compiled [src/File.cpp] >> [src/File.o]
Compiled [src/AGenerator.cpp] >> [src/AGenerator.o]
Compiled [src/GeneratorSVG.cpp] >> [src/GeneratorSVG.o]
Compiled [src/GeneratorCanvas.cpp] >> [src/GeneratorCanvas.o]
Compiled [src/GeneratorPNG.cpp] >> [src/GeneratorPNG.o]
Compiled [src/Header.cpp] >> [src/Header.o]
Compiled [src/pngwriter.cpp] >> [src/pngwriter.o]
Built [wfgen]
Now when I execute the compiled file "wfgen" the console return this message :
[root#ip-***-**-**-*** waveform_generator]# bash wfgen
wfgen: wfgen: cannot execute binary file
Environment :
[root#ip-***-**-**-*** waveform_generator]# uname -i
x86_64
[root#ip-***-**-**-*** waveform_generator]# file wfgen
wfgen: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=2e7c881c6fc10f12cdf49402edae1cc36b8d77a0, not stripped
Do you have a solution to my problem?
Thank you a lot :)
Max.
When you type
[root#ip-***-**-**-*** waveform_generator]# bash wfgen
I think bash expects wfgen to be a shell script. Instead you could directly type the program name at th e prompt
[root#ip-***-**-**-*** waveform_generator]#./wfgen
It looks like the compiling went fine, the output of the file command looks good. I don't know what's in the Makefile, but guess it'll be fine, too.
I don't really know your environment, so I'm taking a bit of a guess here: If everything else went fine, and you still get the cannot execute binary file error, then it can be because your filesystem is mounted with the noexec option.
To check if that's the case, run mount, then determine under which mount point the current directory is, and check if the noexec mount option is set for this mount point.
If it's indeed the noexec problem, you have two options:
Remount the filesystem without the noexec option. If you want this to be permanent, don't forget to edit /etc/fstab. (Note however that noexec might be there for a reason. Make sure it's ok to remove it.)
If it's only one binary, move it to a filesystem that doesn't have the noexec restriction and try from there. A good place would be the /usr/local/bin directory (or /usr/local/sbin, if it's an administrative tool.)

How to work in batch mode

I have inherited an ANSI C++ program that: has no GUIs and is supposed to run in batch mode, generating lots of data (we are talking 100,000+ ASCII files). We are thinking that in long term we’ll run it under UNIX. For now, I have a MacBook Air running OS X 10.9.4 and I loaded Xcode 5.1.1. It compiles without errors or warnings.
I need to test a program as follows:
<prompt> myprogram datain dataout1 datout2
Where is the compiled program? In which directory? Can I copy my datain file in that directory?
For repeated execution under Windows (Command Prompt window) I normally would have a batch file of the type:
myprogram datain1 dataout11 datout12
myprogram datain2 dataout21 datout22
myprogram datain3 dataout31 datout32
........
myprogram datainn dataoutn1 datoutn2
Can I do something similar with OS X? Where can I find the applicable documentation?
You will want to look for your terminal emulation program. See http://en.wikipedia.org/wiki/Terminal_(OS_X) for how to use it, and it should be the bash shell which is one of the unix shells
You can also do a shell script see
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html for some bash shell scripting info
For such a simple operation, you can write a shell script that will look almost exactly the same as the batch file you use on Windows. The key difference between Windows' cmd.exe and *nix shells here is that the current directory is not part of the search path for executables (the way it is on Windows), so if you put the shell script in the same folder as the compiled executable, you will need to prefix the program name with ./ (to mean "look in the current directory"). For example:
#!/bin/sh
./myprogram datain1 dataout11 datout12
./myprogram datain2 dataout21 datout22
./myprogram datain3 dataout31 datout32
........
./myprogram datainn dataoutn1 datoutn2
If the shell script and executable are not in the same folder, you can use either an absolute path or an appropriate relative path.
Also, to run the script you will either need to make it executable:
$ chmod +x myscript.sh
$ ./myscript.sh
or invoke the shell with the script as an argument:
$ sh myscript.sh

VMWARE ESXi PANIC: Failed to find HD boot partition

I've got problems installating the VMWARE ESXi Server.
The Installation finishes without any error messages and prompts me to reboot.
After pressing Enter the System reboots. While booting through the yellow loading-screen it switches to black and displays the following Error-Message:
PANIC: Failed to find HD boot partition
All modules have been loaded without any errors.
After typing unsupported into the console the busybox comes up.
I tooked a look into the /dev/disks directory but no disk devices gets listed in difference to the installation process.
Switching to the system-console during installation both sata disks on MPC51 controller are shown.
The controllers are named vmhba0 and vmhba32.
Does anyone know how to solve the problem?!
Hardware is a ESPRIMO P5615 (nForce4) from Fujitsu-Siemens.
The only solution I have found is to run the server from a thumb drive and use the embedded hard drive to store your virtual servers. This solution worked for me.
To achieve this in this way you will need:
A USB thumb drive 1GB or larger
An active Linux machine (or, use a liveCD option on your PowerEdge such as Knoppix or Gentoo LiveCD)
Mount your ESXi ISO:
mount -t iso9660 -o loop VMware-VMvisor-InstallerCD-3.5.0_Update_2-110271.i386.iso /mnt/esx
Write the installer file to the thumb drive:
tar xvzf /mnt/esx/install.tgz usr/lib/vmware/installer/VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd.bz2 -O | bzip2 -d -c | dd of=/dev/sdb
Assumptions here (adjust to your settings):
/dev/sdb is where your thumb drive resides
VMware-VMvisor-InstallerCD-3.5.0_Update_2-110271.i386.iso is the name of your ISO file
usr/lib/vmware/installer/VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd.bz2 is the name of the dd file in your iso (run tar ztf /mnt/esx/install.tgz to see what your exact file name is, it should be similar and relatively obvious)
It will take a few minutes to write, and when it's done simply boot off of this thumb drive. The PowerEdge servers have an internal USB (at least mine does) if aesthetics are important to you.
Source: http://cyborgworkshop.org/2008/08/30/install-vmware-esxi-onto-a-usb-thumbdrive/
EDIT 12/19/2009: ESXi 4.0.0 uses image.tgz instead of install.tgz to store it's dd file