Skip to content
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

Kernel: Build success? #22

Closed
ghost opened this issue Jan 5, 2020 · 3 comments
Closed

Kernel: Build success? #22

ghost opened this issue Jan 5, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 5, 2020

I checked out origin/master and built according to your instructions.
I am not sure if this is expected behavior, hence the issue.
(1) I get an empty screen that prints out garbage bitmaps when I type.
(2) The command line gives me the following.

scorbie@home:~/Projects/lilith$ make run RELEASE=1
CR src/main.cr
LD64 build/main.o build/boot.o => build/kernel64
objcopy --output-target=binary build/kernel64 build/kernel64.bin
AS32 src/asm/bootstrap.s
i686-elf-as src/asm/bootstrap.s -o build/bootstrap.o
LD build/bootstrap.o => build/kernel
qemu-system-x86_64 -kernel build/kernel -monitor telnet:127.0.0.1:7777,server,nowait -m 512M -serial stdio -no-shutdown -no-reboot -vga std -device intel-hda,debug=9 -device hda-duplex,cad=0,debug=9
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
hda-duplex: hda_audio_init: cad 0
hda-duplex: dac: format: 2 x PCM-S16 @ 48000 Hz
hda-duplex: adc: format: 2 x PCM-S16 @ 48000 Hz
hda-duplex: hda_audio_reset
hda-duplex: hda_audio_reset
intel-hda: intel_hda_update_irq: level 0 [intx]
no handler for 14
no handler for 15
no handler for 15
unknown device type!
no handler for 1
no handler for 12
no main detected.

scorbie@home:~/Projects/lilith$ make run RELEASE=1 NO_CPUEX=1
CR src/main.cr
LD64 build/main.o build/boot.o => build/kernel64
objcopy --output-target=binary build/kernel64 build/kernel64.bin
AS32 src/asm/bootstrap.s
i686-elf-as src/asm/bootstrap.s -o build/bootstrap.o
LD build/bootstrap.o => build/kernel
qemu-system-x86_64 -kernel build/kernel -monitor telnet:127.0.0.1:7777,server,nowait -m 512M -serial stdio -no-shutdown -no-reboot -vga std -device intel-hda,debug=9 -device hda-duplex,cad=0,debug=9
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
hda-duplex: hda_audio_init: cad 0
hda-duplex: dac: format: 2 x PCM-S16 @ 48000 Hz
hda-duplex: adc: format: 2 x PCM-S16 @ 48000 Hz
hda-duplex: hda_audio_reset
hda-duplex: hda_audio_reset
intel-hda: intel_hda_update_irq: level 0 [intx]
no handler for 14
no handler for 15
no handler for 15
unknown device type!
no handler for 1
no handler for 12
no main detected.
@ffwff
Copy link
Owner

ffwff commented Jan 5, 2020

Have you built the userspace yet? Does your project directory have a disk.img file?

You might also want to use make rungdb_img for debugging.

@ghost
Copy link
Author

ghost commented Jan 5, 2020

I am on the process of building, will continue when that succeeds :)
N.B. userspace/toolchain/Makefile @ build_libc may want to change ../libc to ../libraries/libc

Edit: build failed after the above edit. maybe open a new issue?

make[1]: Entering directory '/home/scorbie/Projects/lilith/userspace/libraries/libc'
FREESTANDING=1 crystal build --cross-compile --target  --prelude ./prelude.cr -Ddisable_overflow --freestanding --no-finalizers -d src/main.cr -o .build/libc.cr
Error: Invalid option: --no-finalizers
Makefile:43: recipe for target '.build/libc.cr.o' failed
make[1]: *** [.build/libc.cr.o] Error 1
make[1]: Leaving directory '/home/scorbie/Projects/lilith/userspace/libraries/libc'
Makefile:51: recipe for target 'build_libc' failed
make: *** [build_libc] Error 2

Edit 2: Do I have to supply an ARCH variable when invoking the makefile?

Edit 3: Yes, here's the whole process that, at least, ended without errors:

  1. Make sure to install necessary deps in advance (especially flex & bison, see my comment in Document build dependencies #2 )
  2. Also edit userspace/toolchain/Makefile, target build_libc as I noted above.
  3. Build fails
  4. source ../../env.sh (i.e. the env.sh at lilith's home directory)
  5. Build with make ARCH=x86_64-elf-lilith

Success!

@ghost
Copy link
Author

ghost commented Jan 5, 2020

OMG it works!!! I had to:

  • Comment out mruby as the build was failing
  • make distro
  • Do sudo losetup -d /dev/loop0 whenever the build failed
    (hint: lsblk -f for diagnosis)
  • make run_img RELEASE=1

Now I get the makefile. Kudos for designing this project!

lilith

@ghost ghost closed this as completed Jan 5, 2020
@ghost ghost mentioned this issue Jan 5, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant