YAMSQ - Trouble configuring my build tools

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
bloodline
Member
Member
Posts: 264
Joined: Tue Sep 15, 2020 8:07 am
Location: London, UK

YAMSQ - Trouble configuring my build tools

Post by bloodline »

Apologies for YAMSQ (Yet Another Meaty Skeleton Question).

I'm using a Mac so I've set up my cross compiler via HomeBrew, and I have built the Barebones project easily, added new line support, terminal scrolling and even added keyboard input (by simply polling I/O Port 0x60, and via a lookup table putcharing the scancode->ascii character to the terminal).

But trying to get the meaty skeleton to build is eluding me. I'm pretty experienced with C/C++ and cut my teeth with 68K asm (and proper old school C) on the Amiga, but since moving to unixoid machine I've relied on the VS Studio and XCode to handle the build chain details for me so I'm a total newbie when it come to "make".

I was tempted to just continue adding to the barebones project, but I obviously need a proper working cross compiler to write programs for my hobby OS, so I need to understand what meaty skeleton is doing.

The code in the project is fine, I can see what it's all doing and it all makes sense, the trouble is how to build it using the gnu make system... any assistance would be most welcome! :)

Thanks.
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: YAMSQ - Trouble configuring my build tools

Post by Octocontrabass »

bloodline wrote:by simply polling I/O Port 0x60
You'll want to replace that with a proper IRQ handler. :wink:
bloodline wrote:But trying to get the meaty skeleton to build is eluding me.
What have you tried so far?
bloodline wrote:I'm a total newbie when it come to "make".
We generally recommend being familiar with how your tools work in normal projects before using them to build an OS. It's pretty difficult to learn new tools while writing an OS!
bloodline wrote:I obviously need a proper working cross compiler to write programs for my hobby OS
You need a hobby OS before you need a proper working cross compiler. Until then, you can get away with the same bare metal cross compiler that the Bare Bones tutorial uses.
User avatar
bloodline
Member
Member
Posts: 264
Joined: Tue Sep 15, 2020 8:07 am
Location: London, UK

Re: YAMSQ - Trouble configuring my build tools

Post by bloodline »

Octocontrabass wrote:
bloodline wrote:by simply polling I/O Port 0x60
You'll want to replace that with a proper IRQ handler. :wink:
Yeah, I've been working out how to add the GDT and IDT to the barebones tutorial, which has been quite fun as I've not really used gcc's inline assembler before. Apart from x86 assembly being quite horrid compared to 68k (which is the only other assembler I've really used), I'm enjoying it!

Speaking of which, is there anything stopping me adding the code from the boot.s into my kernel.c via inline asm?
bloodline wrote:But trying to get the meaty skeleton to build is eluding me.
What have you tried so far?
I've tried to follow the meaty skeleton to the letter, set up my sysroot dir and cloned the files from GitHub, then run the build.sh scripts which results in error:

Makefile:23: arch//make.config: No such file or directory
make: *** No rule to make target 'arch//make.config'. Stop.

make syntax is alien to me and this error means nothing.
bloodline wrote:I'm a total newbie when it come to "make".
We generally recommend being familiar with how your tools work in normal projects before using them to build an OS. It's pretty difficult to learn new tools while writing an OS!
I've written my own "operating systems" in the past, for the Amiga hardware. I used to be a game programmer so, getting the OS out of the way, hitting bare metal, and reinventing the wheel are familiar to me... Learning the gnu build chain is going to be the biggest challenge for me with this project.
bloodline wrote:I obviously need a proper working cross compiler to write programs for my hobby OS
You need a hobby OS before you need a proper working cross compiler. Until then, you can get away with the same bare metal cross compiler that the Bare Bones tutorial uses.
Ok! Thanks for replying, this was starting to feel like a very lonely task.

I'm going to keep hacking away at the bear bones code until I get more familiar with the hardware... Then I'll have to figure out making an ELF loader (I've built an Amiga HUNK segloader before so I'm guessing it's not going to be too different.).
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: YAMSQ - Trouble configuring my build tools

Post by iansjack »

I'm afraid I think that this tutorial is pretty poor as it doesn't give any clear build instructions, which is unforgiveable in a tutorial aimed at beginners.. There ought to at least be a README file in the git repository. A BUILDING file would also help.

Anyway, your problem is that the $HOST environment variable isn't set. It may be that this issue: https://gitlab.com/sortie/meaty-skeleton/-/issues/1 is the problem.

TBH, I find OS development is far easier for the beginner when using Linux rather than OS X or, even worse, Windows. This can quite easily be done by running a Linux distribution in a VM, whatever your host OS. Most tutorials are written from a Linux point of view.
User avatar
bloodline
Member
Member
Posts: 264
Joined: Tue Sep 15, 2020 8:07 am
Location: London, UK

Re: YAMSQ - Trouble configuring my build tools

Post by bloodline »

iansjack wrote:I'm afraid I think that this tutorial is pretty poor as it doesn't give any clear build instructions, which is unforgiveable in a tutorial aimed at beginners.. There ought to at least be a README file in the git repository. A BUILDING file would also help.
Yeah, it’s the build instructions which seems the weakest part of this tutorial.
Anyway, your problem is that the $HOST environment variable isn't set. It may be that this issue: https://gitlab.com/sortie/meaty-skeleton/-/issues/1 is the problem.
Ok! This makes sense, thank you for the steer!
TBH, I find OS development is far easier for the beginner when using Linux rather than OS X or, even worse, Windows. This can quite easily be done by running a Linux distribution in a VM, whatever your host OS. Most tutorials are written from a Linux point of view.
I have a Debian VM setup for dev work in VirtualBox, which I was using until a recent update stopped mounting the host drives in the VM... which messed up my workflow and I haven’t been able to figure out what is wrong. So I’ve just been using homebew instead.
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
Post Reply