Giter VIP home page Giter VIP logo

baremetal-os's People

Contributors

coditva avatar gil0mendes avatar giulioz avatar ianseyler avatar not-nik avatar scherrey avatar tay10r avatar vilhelmgray avatar weremsoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

baremetal-os's Issues

How to load BareMetal-OS onto a device.

Hello there. I am wondering if one could explain briefly some inexpensive devices that could be used to install BareMetal-OS from scratch. I understand you can use QEMU or VirtualBox to emulate a blank slate (though I am not sure how that works, I have only used VirtualBox for Linux virtualization on a Mac), and install BareMetal-OS on that from scratch (need to learn more how this works because I still don't see how the boot process works if there is no operating system in place).

But in addition to the emulators, I am wondering if there are actual hardware devices that you can use that don't have any operating systems installed that you can try this out on. I have seen that you can use a RaspberryPI, one of the few bare-metal devices I've come across. Actually, I can't think of anything other than the RaspberryPI as a bare-metal device. But that is ARM, whereas BareMetal-kernel only currently has implemented x86-64. Wondering how you actually can test that out on a real device, I haven't seen any bare-metal x86-64 devices. A quick more recent search brings up this which points to minnowboard (currently unavailable on Amazon), but have to look more around for other x86 stuff. It seems that you have to buy a Dell laptop with Windows preinstalled, and somehow uninstall Windows. Or maybe there is a ChromeBook way. If that's the case, would love to know how that works to get initialized with an x86-64 bare-metal machine.

Anyway, thank you for your help. Looking forward to trying this out on a real device.

setup.sh fails on Linux

Pulling code from GitHub...
Creating disk image...
monitor.asm:154: error: symbol `b_disk_read' not defined
monitor.asm:211: error: symbol `b_disk_read' not defined
monitor.asm:225: error: symbol `b_disk_read' not defined
Building src/Pure64...
Building src/BareMetal...
Building src/BareMetal-Monitor...
monitor.asm:154: error: symbol `b_disk_read' not defined
monitor.asm:211: error: symbol `b_disk_read' not defined
monitor.asm:225: error: symbol `b_disk_read' not defined
./setup.sh: 33: ./bmfs: not found
Building OS image...
cat: pure64.sys: No such file or directory
cat: kernel.sys: No such file or directory
cat: monitor.bin: No such file or directory
Done!

on Ubuntu 22.04.01 LTS, Linux 5.15.0-53-generic (x86_64)

After using setup install run. bat scripts from site no boot with qemu

Hi i just downloaded Baremetal-Os install scripts run the scripts on Windows (.bat) files.
Setup.bat
install.bat
run.bat
Everything compiled ok and Bmfs image generated ok.
I type Run.bat -> qemu starts but is having boot problems with the hdd - is looping somehow.

If i change in install.bat lines to
copy /b ".\bin\bmfs_mbr.sys" + ".\bin\pure64.sys" ".\bin\software.sys"
call ".\bin\BMFS\src\bmfs.exe" "bin\bmfs.image" initialize 128M "bin\software.sys"

recompile and then run again to boot with qemux64 and i get the message BMFS v1.0 - error
something is wrong with image or boot binary check ... Can you please help me on this ..i can't boot Baremetal using Qemu on win 64

Cheers,
Alex

setup.sh cp command fails on macOS

It appears to be back again. I did a fresh git clone today, ran setup.sh, and:

Entering /Users/paul/dev/BareMetal-OS/src/BMFS/utils
 CC      /Users/paul/dev/BareMetal-OS/src/BMFS/utils/bmfs.o
 LD      /Users/paul/dev/BareMetal-OS/src/BMFS/utils/bmfs
Updating /Users/paul/dev/BareMetal-OS/output/bin/bmfs
cp: illegal option -- -
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory

'cp --update' appears in several places, and on Mac the 'cp' command does not support the '--update' option. Some people have suggested using 'rsync' to get similar behavior (as it does allow the '--update' option).

ld errors

Trying to link xxd.c, ld spits out this error:
xxd.c:(.text+0x2fb): undefined reference to '__stack_chk_fail'
quick google said that it's a stack protector, -fno-stack-protector solves it
Is it okay to use this linker flag?

What libs are avalible

I am going to try to port a few applications over to BareMetal for a project I am dreaming up. It would be nice to have a full list of libraries provided "out of the box" as well as ones that can be added without porting.

newlib.sh refers to missing legacy repo

newlib.sh refers to src/BareMetal-OS directory, which does not exist after setup.sh is run.

Examination made determined this is now actually the BareMetal-OS-legacy repo, which also is not installed by setup.sh.

It appears manually doing the git clone of the legacy repo, into the src dir, and renaming to BareMetal-OS is required, as other scripts still refer to it under the name which is now for the scripts repo.

Should this script be removed and be replaced by git cloning BareMetal-newlib instead?

How to build ethtoolc

I would like to build ethtoolc.c and some of the other apps but they won't build from app.sh or the makefile in Examples or even using the instructions in the top of the source file. I just need some pointers/general direction on where to start. I naively tried the following based on the comments in the source file:

gcc -c -m64 -nostdlib -nostartfiles -nodefaultlibs -o ethtoolc.o ethtoolc.c -I ../../output/include -I ../
gcc -c -m64 -nostdlib -nostartfiles -nodefaultlibs -o libBareMetal.o libBareMetal.c
ld -T example.ld -o ethtoolc.app ethtoolc.o libBareMetal.o  -L ../../output/lib -L ../../output/x86_64-pc-baremetal/lib/ -lc -lbmfs -L ../Alloy/lib -lalloy

but where do I get definitions for b_output, et. al.?

ethtoolc.o: In function `main':
ethtoolc.c:(.text+0x17): undefined reference to `b_output'
ethtoolc.c:(.text+0x17): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `b_output'
ethtoolc.c:(.text+0x2b): undefined reference to `b_system_config'
ethtoolc.c:(.text+0x2b): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `b_system_config'
ethtoolc.o: In function `ethtool_send':
ethtoolc.c:(.text+0xc7): undefined reference to `b_ethernet_tx'
ethtoolc.c:(.text+0xc7): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `b_ethernet_tx'
ethtoolc.o: In function `ethtool_receive':
ethtoolc.c:(.text+0x101): undefined reference to `b_ethernet_rx'
ethtoolc.c:(.text+0x101): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `b_ethernet_rx

Virtual box image not working - Same result as in real hardware

I successfully build the image for virtualbox, I created a VM in virtualbox 7, but when I try to run I got a black screen with some big pixels on the top. This is the same result I get when I try to run the image in real hardware.

Screenshot attached.

image

Virtual Machine log follows:

VBox.log

Several questions about the project

Probably not the best place to ask, but here we go:

  1. In which mode/ring the code runs? Can I assume that the examples code runs on kernel mode?
  2. Do I have access to the whole memory? In my case, can I read all my 32GB of ram creating an example-like program?
  3. If I create a program like "helloc.c", should I assume that I'm in 64bit mode (IE, no pusha/popa instructions in assembly)?
  4. What list of utilities can I use from the BIOS? Can I call UEFI things or only old 16-bit kind of interrupts? Or deppends how I boot the kernel?
  5. In the graphics.c demo, I can see that the program gets the current resolution reading the memory position at 0x5088, what are this positions? where I can get a reference from the information available for my program?
  6. Should I assume that the bios will reset the program after 5 minutes or so? Is there a way to prevent this? Does it has some side effect (IE: being unable to call certain BIOS functions)?
  7. I'm trying to read keyboard to make a standalone game, so I want to set a memory buffer on 1 when the key is pressed and set it back to 0 when the key is released, does the kernel provides any service to do this (since it has a shell) or should I set the interrupt handlers myself?

Thanks such an amazing project.

app.sh needs update

app.sh also refers to non-existent ./src/BareMetal-OS/programs directory, which is only found in the BareMetal-OS-legacy repo.

Add Automake to Requisites

I just wanted to let you guys know that you should add "automake" to the list of requisites to build this kernel or else some machines won't be able to use "aclocal"

Aside from that... this kernel was SUPER easy to build and run! Works flawlessly on OS X.

run.sh does not boot properly

I'm not very familiar with bare metal but it is displaying some weird characters on top right and nothing else.

Am I doing something wrong?

I'm using;

./build.sh ./install.sh ./run.sh

after setup.

Using Git Submodules

It may be useful to use Git Submodules instead of downloading the repositories via a script. This way, we can ditch setup.sh and setupt.bat entirely. Instead, you just use git submodule update --init --recursive. You can continue to make new commits in the submodules, and push them using git push origin HEAD:master.

Travis CI

I think this project should have a Travis CI account. We could use it to deploy disk images every time a release is published on GitHub.

The tutorial is here.

@IanSeyler if you active the repository in Travis CI then I can set the rest of it up.

And while I don't think that the project is currently ready for a release, the service is also useful for testing the project in a sandbox environment. Travis CI will build the project every time a set of commits is pushed to GitHub. It will send an alert via email if this build fails.

no graphic related demo is running

I'm using ubuntu 24.04 and quemu 8.2.2.

All run exept for gavare.app and graphics.app. graphics.app seems to be able to put pixels in the firs row of the screen, but no more. The emulator does not hangs, the shell keeps being operative and the rest of the programs can be loaded and executed, but no graphics is shown.

I love the project.

Thanks for putting time on this.

How do I boot it on to a machine from a bootable usb?

I am quite a noob into bare metal, I want to explore baremetal os, first thing I want to do is to be able to boot it into a machine from a bootable usb, I feel like I am lost completely, any help is appreciated.

App Scripts Improvements

Currently, the app compile scripts are:

  • app.sh - assembles an assembly app
  • `appc.sh - compiles a C app

There should just be one app.sh, and it should:

  • determine whether to assemble or compile the app based on the file extension
  • list the available apps (as hello.app, cat.app ... etc), if no app was passed to the script

Cannot run newlib test app

After building the test app with newlib, I'm copying it into output/apps and run;

cd output
bin/bmfs baremetal-os.img create test.app 2
bin/bmfs baremetal-os.img write test.app "apps/test.app"
cd ..
./run.sh

Then I enter test.app and qemu system hangs. I'm not sure what is going on.

"No filesystem detected" after setting up and running

I'm getting "No filesystem detected" after running commands like dir, load, etc.

Here's the complete command history:

$ git clone https://github.com/ReturnInfinity/BareMetal-OS.git
$ cd BareMetal-OS/
$ ./baremetal.sh setup
Pulling code from GitHub...
Downloading UEFI firmware...
Creating disk images...
Preparing dependancies...
Building src/Pure64...
Building src/BareMetal...
Building src/BareMetal-Monitor...
Building src/BMFS...
Building src/BareMetal-Demo...
Building OS image...
Done!
$ ./baremetal.sh run
Starting QEMU...

Right after, the QEMU window shows up with the OS loaded. I can type things into the prompt and so on.
Here's the result after executing dir:
Screenshot_20240513_001402

Any steps I might be missing in the setup?

App files

Hi,
Where the app examples are, how hello.asm, and how running It in BM?
Best regards

Support for imgui/opengl

A wonderful improvement for BareMetal-OS would be to be able to launch ImGui apps.
This would require OpenGL v2 or v3 to be present.

Some info about ImGui:

Dear ImGui is a bloat-free graphical user interface library for C++. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).

Dear ImGui is self-contained within a few files that you can easily copy and compile into your application/engine

I believe that no-dependencies, lightweightness and cool looks would be its great advantages.

Error in build.sh

Hi,

When I run:

$ ./setup.sh
Pulling code from GitHub...
Creating disk image...
Building src/Pure64...
Building src/BareMetal...
Building src/BareMetal-Monitor...
Building src/BMFS...
Building OS image...
Done!

$ ./build.sh
Building src/Pure64...
Building src/BareMetal...
Building src/BareMetal-Monitor...
Building src/BMFS...
mkdir: cannot create directory β€˜bin’: File exists

[... add a new b_output() call to BareMetal-OS/src/BareMetal-Demo/src/helloc.c before the 'Hello, world!' b_output() call for testing purposes ...]

$ ./install-demos.sh
Error: File already exists.
Error: File already exists.
Error: File already exists.
Error: File already exists.
Error: File already exists.

$ ./run.sh

load
Enter file number: 4
exec
Hello, world!

This is what I see - the b_output() call which should have come before the 'Hello, world!' print isn't there. I can't tell if helloc.c is being rebuilt or not, but it also(?) looks like install-demos.sh isn't overwriting the old demo files on the BMFS image or rebuilding the whole disk image from scratch, depending on what is necessary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.