Vampyre wrote:tried to rebuild read_kernel and now i get this but all files are in the folder
C:\>C:\Users\vampy\Documents\PcmHacks-2019.01.16.02\PcmHacks-2019.01.16.02\Kernels\build.bat
m68k-elf-gcc.exe: error: main.c: No such file or directory
m68k-elf-gcc.exe: error: micro-kernel.c: No such file or directory
m68k-elf-gcc.exe: fatal error: no input files
compilation terminated.
c:\SysGCC\m68k-elf\bin\m68k-elf-ld.exe: cannot open linker script file micro-kernel.ld: No such file or directory
c:\SysGCC\m68k-elf\bin\m68k-elf-objcopy.exe: 'micro-kernel.elf': No such file
Access is denied.
m68k-elf-gcc.exe: error: main.c: No such file or directory
m68k-elf-gcc.exe: error: read-kernel.c: No such file or directory
m68k-elf-gcc.exe: error: common.c: No such file or directory
m68k-elf-gcc.exe: fatal error: no input files
compilation terminated.
c:\SysGCC\m68k-elf\bin\m68k-elf-ld.exe: cannot open linker script file read-kernel.ld: No such file or directory
c:\SysGCC\m68k-elf\bin\m68k-elf-objcopy.exe: 'read-kernel.elf': No such file
Access is denied.
*-kernel.bin
The system cannot find the file specified.
0 file(s) copied.
Volume in drive C has no label.
Volume Serial Number is 6872-1878
Either the GNU M68k toolchain is not installed or not installed where the hard coded build.bat expects it to be, you either need to put things exactly where the batch file expects things to be or you need to modify the batch file.
It appears you are using an old build.bat, and the .ld files for micro-kernel.c and read-kernel.c are missing.
I would venture to guess a mash of particulate from different versions.
As a tip, create a directory one level below PcmHacks (I use 'Lib') and add it to your LOCAL path only, not the system path!
Example:
I create my directory structure something like:
Code: Select all
[drive:\...]\Automotive\PcmHacks\PcmHacks
[drive:\...]\Automotive\PcmHacks\Lib
Where PcmHacking Suite source code (local Git repo) is.
[drive:\...]\Automotive\PcmHacks\PcmHacks
Common directory for PcmHacking Suite.
[drive:\...]\Automotive\PcmHacks\Lib
Then in that common directory create a batch file called: envset.cmd, like,
Code: Select all
@echo off
set path=%path%;[drive:\...]\Automotive\PcmHacks\lib
(One could also add the path to the GNU M68k \bin directory here and remove the hard coded path in the local build batch file)
Obviously this is Windows, you need to adjust the [drive:\...] to match your system.
Then you can open a command prompt from Explorer by browsing to and selecting the Kernels directory then,
Hold: Shift Key
Right-Click: Kernels
Select: Open Command Window Here
Then run '..\..\lib\envset' from the Kernels directory.
This allow the use of your own 'bld.cmd' batch file like the following that is placed in the common directory ... It also gives a location that is in the path specifically for PcmHacking Suite for other tools one might want when working on the PcmHacking Suite without polluting the system path.
(It would be helpful if the PcmHacks build.bat was renamed to build.cmd, .bat executes before .cmd, this would allow people to use their own build.bat and have it execute before PcmHacks build.cmd, without editing their environment)
Code: Select all
@setlocal
@echo off
REM * Set option defaults here ...
set GCC_LOCATION=C:\SysGCC\m68k-elf\bin\
goto beginning
* Create a non executed area for our header, notes and routines/procedures.
*********************************************************************
*
* Name :
* Description :
* Author :
* Authored Date:
* Revision Date:
*
* Notes
* : -fomit-frame-pointer = remove the boilerplate linkw/unlk instructions
* : -c = compile but do not link
* : -O1 = optimization level
* : -g = include debug information - not using this because the
* : disassembly is either corrupt or just incomprehensible
*
*
*************************************** Routines/Procedures
* Here we'll collect our routines/procedures ...
*
* Removes trailing slash if it exists
:Detrailslash in out
set A=%~1
if %A:~-1%==\ (
set %2=%A:~0,-1%
) else (
set %2=%A%
)
goto :EOF
*
*
*************************************** Beginning
* Let us get to it!
:beginning
REM * Ensure we have no trailing slash.
call :Detrailslash "%GCC_LOCATION%" GCC_LOCATION
REM *** write-kernel
"%GCC_LOCATION%\m68k-elf-gcc.exe" -c -fomit-frame-pointer -std=gnu99 -mcpu=68332 -O0 main.c write-kernel.c crc.c common.c common-readwrite.c flash.c flash-intel.c flash-amd.c
if %errorlevel% neq 0 goto :eof
"%GCC_LOCATION%\m68k-elf-ld.exe" -T kernel.ld main.o write-kernel.o crc.o common.o common-readwrite.o -o kernel.elf flash.o flash-intel.o flash-amd.o
if %errorlevel% neq 0 goto :eof
"%GCC_LOCATION%\m68k-elf-objcopy.exe" -O binary --only-section=.kernel_code --only-section=.rodata kernel.elf kernel.bin
if %errorlevel% neq 0 goto :eof
"%GCC_LOCATION%\m68k-elf-objdump.exe" -d -S kernel.elf > kernel.disassembly
if %errorlevel% neq 0 goto :eof
if not exist ..\Apps\PcmHammer\bin\debug (
mkdir ..\Apps\PcmHammer\bin
mkdir ..\Apps\PcmHammer\bin\Debug
)
echo kernel.bin
copy kernel.bin ..\Apps\PcmHammer\bin\debug\kernel.bin
This can be expanded on by creating a shortcut that opens a command prompt that runs 'envset.cmd' and leaves you at the 'Kernels' prompt ready to type bld (or build). I choose not to.
Hopefully this is brain food for someone ...
-Enjoy