-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compile error in serial1.c on MacOS #5
Comments
Hey, the reason for that was because .bss was initialized pretty late. So, I just pushed a change where .bss (basically, the whole section needs to be zeroed) will now be initialized early on in the assembly. See: 0064e3d macOS is not exactly supported, as I don't have a mac. Still, hope that helps. I don't really expect this setup to work on mac, but it would be nice if it did. |
Yes, that fix section problem, but after installing NASM with brew, got this new errors: Jarvis2:barebones thierry$ ./run.sh /Users/thierry/Dev/barebones/src/kernel/start.asm:17: error: segment name `.multiboot' not recognized |
What happens if you try building with Clang? You will probably have to download elf.h and link.h yourself, as I dont think I will be adding those manually into the repo. Although, I could do without link.h and just create the prototype for the stub myself, and then do provide elf.h. In the end, you do need a compiler that builds for linux and not macOS. Clang can do that with -target. |
I clean build dir then call run.sh again, and in fact it seems that I already used Clang compiler, but Apple version one... Jarvis2:barebones thierry$ ./run.sh |
Try installing clang using brew and use that. Although, if you just want this project to work then install Ubuntu desktop in VirtualBox or some other desktop virtualization application and it should just work out of the box. |
Yes I know that, but I thought could be cool to have source code directly compatible with MacOS. Thanks for your help fwsGonzo |
The problem is that sections are named differently on macOS, but even so I think the ABI stuff is different too and that means there will be incompatibilities. |
ok, I find apple compatible version of elf.h and link.h (and dependencies) in Apple site here https://opensource.apple.com/source/dtrace/dtrace-96/sys/ AppleClang compiler are no more complains, just see how to fix .multiboot problem ... must dig in my own kernel sample I wrote few months ago |
hello,
Get this error when trying to build_iso.sh on MacOS
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/thierry/Dev/barebones/machines/default/build
Scanning dependencies of target exceptions
Scanning dependencies of target tinyprintf
[ 7%] Building C object ext/CMakeFiles/tinyprintf.dir/tinyprintf/tinyprintf.c.o
[ 7%] Creating directories for 'exceptions'
[ 11%] Performing download step (download, verify and extract) for 'exceptions'
-- Downloading...
dst='/Users/thierry/Dev/barebones/machines/default/build/exceptions/src/exceptions.zip'
timeout='none'
-- Using src='https://github.com/fwsGonzo/barebones/releases/download/exceptions/exceptions.zip'
[ 14%] Linking C static library libtinyprintf.a
[ 14%] Built target tinyprintf
Scanning dependencies of target kernel
[ 25%] Building C object src/CMakeFiles/kernel.dir/hw/serial1.c.o
[ 25%] Building C object src/CMakeFiles/kernel.dir/crt/c_abi.c.o
[ 25%] Building C object src/CMakeFiles/kernel.dir/kernel/kernel_start.c.o
/Users/thierry/Dev/barebones/src/hw/serial1.c:4:48: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and
section separated by a comma
static char initialized attribute((section(".data"))) = 0;
^
1 error generated.
make[2]: *** [src/CMakeFiles/kernel.dir/hw/serial1.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/Users/thierry/Dev/barebones/src/kernel/kernel_start.c:6:13: warning: unused function '__init_paging' [-Wunused-function]
static void __init_paging()
^
1 warning generated.
The text was updated successfully, but these errors were encountered: