Bran's Kernel Dev
Posted: Mon Jul 23, 2007 12:05 pm
I was doing his tutorial and i came across a strang phenomenon. my batch file that i wrote never creates main.o even though in a seperated batch file it works fine.
I was going to attach a zip file but... 64kb limit??\
batch file
dev tutorial
I was going to attach a zip file but... 64kb limit??\
batch file
Code: Select all
@echo off
if /h==%1 (GOTO exitc)
if /help==%1 (GOTO exitc)
echo Setting Up The Environment
cd C:\asm\
call C:\djgpp\bin\setdjgpp.bat C:\djgpp\ C:/djgpp/
echo Environment Setup Complete
echo Compiling assembly
echo nasm
nasm.exe -E errors.txt ostest.asm -f aout -o ostest.o
echo gcc
C:\djgpp\bin\gcc.exe -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I.\include -c -o main.o main.c
REM Call gccbatch.bat
echo ld
C:\djgpp\bin\ld.exe link.ld -o main.o ostest.o
echo Compile Attempt Finished
if exist "ostest.o" (GOTO DoPartCopy)
GOTO exita
:DoPartCopy
copy /b ostest.o+main.o ostest.img
call :InsertImgOnDisk "ostest.img"
GOTO exita
:InsertImgOnDisk
echo PartCopy.exe %1 0 %~z1 -f0
PartCopy.exe %1 0 %~z1 -f0
GOTO exitfinal
:exitb
echo .
echo ==================================
echo ========== Final Status ==========
echo ==================================
echo ==Operating System Not Installed==
echo ==================================
if /d==%1 (GOTO exitd)
if /d==%2 (GOTO exitd)
echo cleaning up...
del "main.o"
del "ostest.o"
del "ostest.img"
echo done.
pause
GOTO exitd
:exita
echo .
echo ==============================
echo ======== Final Status ========
echo ==============================
echo ==Operating System Installed==
echo ==============================
if /d==%1 (GOTO exitd)
if /d==%2 (GOTO exitd)
echo cleaning up...
del "main.o"
del "ostest.o"
del "ostest.img"
echo done.
GOTO exitd
:exitc
echo Operating System Installer
echo Usage "[LOCATION\]install ostest.bat" [/h, /help, /?] [/d]
echo Example "install ostest.bat" /d
echo Commands
echo "/d" Skips end of batch cleanup (which removes the objects, the OS Image, and the error log)
echo "/h" "/help" Help commands, display this message (and ends the batch immediately)
:exitd
GOTO exitfinal
:exitfinal