How-to-Make-a-Computer-Operating-System icon indicating copy to clipboard operation
How-to-Make-a-Computer-Operating-System copied to clipboard

Chapter 2: "make run" fails

Open makcakaya opened this issue 10 years ago • 7 comments

make run fails at chapter 2.

make all completed successfully and when I run make run it fails with the following message:

: command not founde 35: : No such file or directorydev/loop1 make: *** [run] Error 1

Could you help?

makcakaya avatar Mar 01 '15 16:03 makcakaya

Can you post the makefile you used? It sounds like you should replace dev/loop1 with /dev/loop1

JohnPalladino avatar Mar 02 '15 02:03 JohnPalladino

I'm running Windows 8.1 and below are the Makefile and sdk/diskimage.sh. Thanks.

This is the Makefile:

SDKDIR=./sdk

help: @echo "Makefile for Building Dev Operating System." @echo "Usage: make [ all | clean | help | build | run] " @echo "" @echo

all: @echo "Building Kernel" make -C ./kernel @echo "Building SDK" make -C ./sdk @echo "Building Userland" make -C ./userland

build: zip -r devos-$(VERSION).zip ./

run: @echo "Running Dev Operating System." cd ./sdk && sudo bash ./diskimage.sh cd ./sdk && ./qemu.sh

clean: make -C ./kernel clean make -C ./userland clean

This is sdk/diskimage.sh where I believe it fails:

#!/bin/bash
qemu-img create c.img 2M
fdisk ./c.img << EOF
x
c
4
h
16
s
63
r
n
p
1
1
4
a
1
w
EOF
fdisk -l -u ./c.img
losetup -o 32256 /dev/loop1 ./c.img

mke2fs /dev/loop1
"diskimage.sh" 36 lines, 404 chars

makcakaya avatar Mar 07 '15 15:03 makcakaya

I get the same errors on my Windows 10 with Oracle VM Virtualbox. :-/

suriyaa avatar Aug 12 '15 09:08 suriyaa

your development environment must install in the wrong address,try recovery, and install in the root address

Moersity avatar Feb 13 '16 04:02 Moersity

@uestclixiang @SamyPesse How can I do that correctly?

suriyaa avatar Feb 13 '16 10:02 suriyaa

@SamyPesse same problem on my Windows machine as well. Is there any resolution to this?

ionuttamas avatar May 10 '16 21:05 ionuttamas

I'm having the same issue. At least in Ubuntu 20.04, several /dev/loop?? devices are being used for system snapshots. You have to run {losetup} to figure out which loop device is open (on mine, it's loop13) and then probably run it with sudo. Most of the other commands also require root privileges.

Right now, mine is stuck on the grub command because there are several types/versions on Ubuntu.

RichCini avatar Aug 17 '21 18:08 RichCini