Public Repository

Last pushed: a year ago
Short Description
Create Mike Simple 16 bit os under Mac docker : http://mikeos.sourceforge.net/write-your-own-os.html
Full Description

Create Mike Simple 16 bit os under Mac OS X - docker ...

follows: http://mikeos.sourceforge.net/write-your-own-os.html

If you do not know docker, follow this first: https://docs.docker.com/mac/

Install docker toolbox on Mac and use the terminal interface

  1. docker run -t -i ubuntu /bin/bash
    • see https://docs.docker.com/engine/quickstart/
    • need -i interactive -t pseudo TTY (stdio)
    • Ctrl-p Ctrl-q to detach from the shell but not exit
    • docker ps all running container
    • docker ps -a stopped and running container
  2. apt-get update * need this otherwise would not install
  3. apt-get install build-essential qemu * answer y
  4. exit * make sure you get the hash number
  5. docker commit hash-code-like-number dng8888/mikesimple-ubuntu
  6. docker run -t -i -v ~/Downloads:/root/downloads dng8888/mikesimple-ubuntu /bin/bash
  7. run the build commands there


    • nasm -f bin -o myfirst.bin myfirst.asm
    • dd status=noxfer conv=notrunc if=myfirst.bin of=myfirst.flp
    • qemu-system-i386 -fda myfirst.flp -curses

      • need qemu-system-i386 not qemu
      • need -curses otherwise SDL issues
      • cannot use -nographic as that is for -kernel
        -
        • change the command, need curses (esc 2) then quit
        • try (alt 2) (Ctrl-alt 2) not under this
          -
      • To avoid "WARNING: Image format was not specified for 'myfirst.flp' and probing guessed raw.
      • Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
      • Specify the 'raw' format explicitly to remove the restrictions."
    • qemu-system-i386 -drive file=myfirst.flp,format=raw -curses * see error messages


  8. To run mkisofs need to apt-get install ... (not working)

    • apt-get install apt-file
    • apt-file update
    • apt-file search mkisofs - genisoimage: /usr/bin/mkisofs
    • apt-get install genisoimage - may consider Suggested packages: wodim cdrkit-doc file

    • mkdir cdiso
    • cp myfirst.flp cdiso
    • mkisofs -o myfirst.iso -b myfirst.flp cdiso/
    • with an error message "Size of boot image is 4 sectors -> genisoimage:
    • Error - boot image 'cdiso/myfirst.flp' has not an allowable size."
    • qemu-system-i386 -drive file=myfirst.iso,format=raw -curses - error
    • qemu-system-i386 -cdrom myfirst.iso -curses - error got cdrom but still
  9. Commit the latest image and push it to docker

    • exit
    • docker images
    • docker commit hash_code dng8888/mikesimple-ubuntu:V2
    • docker login --username=_ --email=__
    • docker push dng8888/mikesimple-ubuntu * not just V2 as the early one would not be pushed

Helper info:

Some useful docker commands

general

  • docker info

tools

  • Ctrl-p Ctrl-q to detach from the shell but not exit
  • docker ps all running container
  • docker ps -a stopped and running container
  • docker images
  • docker tag 7d9495d03763 maryatdocker/docker-whale:latest
  • docker login --username=yourhubusername --email=youremail@company.com
  • docker commit <container> <some_name>
  • docker push maryatdocker/docker-whale
  • docker rmi -f 7d9495d03763 * you need to use the image id to remove all
    or one-by-one docker rmi -f docker-whale
  • docker pull ubuntu ...
  • docker -H ...
  • docker rmi $(docker images -f "dangling=true" -q) * remove <NONE><NONE>

examples: https://docs.docker.com/engine/userguide/

run ubuntu

  • docker run -t -i ubuntu /bin/bash

see also https://docs.docker.com/engine/installation/linux/ubuntulinux/

======= myfirst.asm ==========

    BITS 16

start:
    mov ax, 07C0h        ; Set up 4K stack space after this bootloader
    add ax, 288        ; (4096 + 512) / 16 bytes per paragraph
    mov ss, ax
    mov sp, 4096

    mov ax, 07C0h        ; Set data segment to where we're loaded
    mov ds, ax


    mov si, text_string    ; Put string position into SI
    call print_string    ; Call our string-printing routine

    jmp $            ; Jump here - infinite loop!


    text_string db 'This is my cool new OS from Mike copy by Dennis!', 0


print_string:            ; Routine: output string in SI to screen
    mov ah, 0Eh        ; int 10h 'print char' function

.repeat:
    lodsb            ; Get character from string
    cmp al, 0
    je .done        ; If char is zero, end of string
    int 10h            ; Otherwise, print it
    jmp .repeat

.done:
    ret


    times 510-($-$$) db 0    ; Pad remainder of boot sector with 0s
    dw 0xAA55        ; The standard PC boot signature

==== error message of using iso image ========

            Booting from Floppy...
            Boot failed: could not read the boot disk

            Booting from DVD/CD...
            Boot failed: Could not read from CDROM (code 0003)
            Booting from ROM...
            iPXE (PCI 00:03.0) starting execution...ok
            iPXE initialising devices...ok



            iPXE 1.0.0+git-20150424.a25a16d-1ubuntu1 -- Open Source Network Boot Firmware --
             http://ipxe.org
            Features: DNS HTTP HTTPS iSCSI NFS TFTP AoE ELF MBOOT PXE bzImage Menu PXEXT

            net0: 52:54:00:12:34:56 using 82540em on PCI00:03.0 (open)
              [Link:up, TX:0 TXE:0 RX:0 RXE:0]
            Configuring (net0 52:54:00:12:34:56)............... ok
            net0: 10.0.2.15/255.255.255.0 gw 10.0.2.2
            net0: fe80::5054:ff:fe12:3456/64
            Nothing to boot: No such file or directory (http://ipxe.org/2d03e13b)
            No more network devices

            No bootable device.

===== error messsage 2 using -cdrom version ======

            Booting from Floppy...
            Boot failed: could not read the boot disk

            Booting from DVD/CD...
            Boot failed: Could not read from CDROM (code 0003)
            Booting from ROM...
            iPXE (PCI 00:03.0) starting execution...ok
            iPXE initialising devices...ok



            iPXE 1.0.0+git-20150424.a25a16d-1ubuntu1 -- Open Source Network Boot Firmware --
             http://ipxe.org
            Features: DNS HTTP HTTPS iSCSI NFS TFTP AoE ELF MBOOT PXE bzImage Menu PXEXT

            net0: 52:54:00:12:34:56 using 82540em on PCI00:03.0 (open)
              [Link:up, TX:0 TXE:0 RX:0 RXE:0]
            Configuring (net0 52:54:00:12:34:56)............... ok
            net0: 10.0.2.15/255.255.255.0 gw 10.0.2.2
            net0: fe80::5054:ff:fe12:3456/64
            Nothing to boot: No such file or directory (http://ipxe.org/2d03e13b)
            No more network devices

            No bootable device.
Docker Pull Command
Owner
dng8888

Comments (0)