Question:
What programming language is used to ASSEMBLE the KERNEL, BOOTLOADER, and other stuff?
?
2013-12-02 05:17:34 UTC
For example consider the code.......






#!/bin/sh

if test "`whoami`" != "root" ; then
echo "You must be logged in as root to build (for loopback mounting)"
echo "Enter 'su' or 'sudo bash' to switch to root"
exit
fi

if [ ! -e disk_images/mikeos.flp ]
then
echo ">>> Creating new MikeOS floppy image..."
mkdosfs -C disk_images/mikeos.flp 1440 || exit
fi

echo ">>> Assembling bootloader..."

nasm -O0 -w+orphan-labels -f bin -o source/bootload/bootload.bin source/bootload/bootload.asm || exit

echo ">>> Assembling MikeOS kernel..."

cd source
nasm -O0 -w+orphan-labels -f bin -o kernel.bin kernel.asm || exit
cd ..

echo ">>> Assembling programs..."

cd programs

for i in *.asm
do
nasm -O0 -w+orphan-labels -f bin $i -o `basename $i .asm`.bin || exit
done

cd ..

echo ">>> Adding bootloader to floppy image..."

dd status=noxfer conv=notrunc if=source/bootload/bootload.bin of=disk_images/mikeos.flp || exit


echo ">>> Copying MikeOS kernel and programs..."

rm -rf tmp-loop

mkdir tmp-loop && mount -o loop -t vfat disk_images/mikeos.flp tmp-loop && cp source/kernel.bin tmp-loop/

cp programs/*.bin programs/*.bas programs/sample.pcx tmp-loop

sleep 0.2

echo ">>> Unmounting loopback floppy..."

umount tmp-loop || exit

rm -rf tmp-loop

echo ">>> Creating CD-ROM ISO image..."

rm -f disk_images/mikeos.iso
mkisofs -quiet -V 'MIKEOS' -input-charset iso8859-1 -o disk_images/mikeos.iso -b mikeos.flp disk_images/ || exit

echo '>>> Done!'
Three answers:
jplatt39
2013-12-02 06:16:55 UTC
Assemble? It sounds by the way like you're playing with Linux or BSD. GNU Compiler Collection uses the AS assembler, however most of us also use nasm or yasm which you listed in your examples.
roderick_young
2013-12-04 07:25:10 UTC
That's a shell script. It's meant to be kept as a text file, and run by the shell. In Linux or unix, you would set the executable bit on the file properties to make the script runnable.
Sm Rashed
2013-12-02 14:27:13 UTC
it is good topic for web design everybody learn this.thanks


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...