OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 9:55 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: How to boot into nothing ?
PostPosted: Mon Jun 29, 2020 7:38 am 
Offline

Joined: Mon Jun 29, 2020 7:17 am
Posts: 1
I am following a course which involves creating a simple kernel(as the instructor calls it) which I can run on a VM(virtualbox) and debugging using gdb(running on another VM - ubuntu) over serial port. The video tutorial shows use of these two files:

    memdisk
    floppy.img

after this
Code:
sudo mount temp/ /dev/sdb1/
command
the two files are copied to the temp/ directory .

There is also this command used :

Code:
sudo grub-install --root-directory temp/ /dev/sdb1/


The final result was: after placing this HardDisk(vhd) in a virtual machine, it should boot up to a screen like this :
Image

some gdb commands that the instructor runs on the Ubuntu VM (after the above screen has come up):

Code:
set debug remote 1
set remotebaud 38400
target remote /dev/ttyS0
c
load lab.out


further details:

The contents of menu.lst inside temp/boot/grub/:

Quote:
title GDB
root (hd0, 0)
####### The hdx part depends on the number of harddisks
####### you have. If you have one harddisk then the
####### memory stick would be hd1 and the entry will
####### be root (hd1, 0)
####### The second zero is actually dependent
####### on /dev/sda1. If it is sdaN the number will be
####### N-1

kernel /memdisk
initrd /floppy.img



contents of grub.cfg in temp/boot/grub/:

Quote:
set default=0 #assumes (hd0) to be default partition
set timeout=10 #the system will autoboot in 10 seconds
menuentry "GDB boot"{
linux16 /memdisk
initrd16 /floppy.img
boot
}


My questions:
1. What are those floppy.img and memdisk files and how can I aquire or create them ?
2. What is this kernel which sticks on
Quote:
booting...
called ?
3. How to boot into this nothing i.e just
Quote:
booting...
? How to achieve this so that I can load programs to this machine using gdb on another machine as mentioned above?

I tried creating a blank floppy.img using
Code:
mkfs.msdos -C myfloppy.img 1440
and also aquired memdisk from syslinux but didn't work

The reason I am asking this here is that the instructor did not provide links to download those files. Please bear with me and suggest a way using which I can accomplish the above.


Top
 Profile  
 
 Post subject: Re: How to boot into nothing ?
PostPosted: Tue Jun 30, 2020 2:14 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5137
sweetpoision wrote:
1. What are those floppy.img and memdisk files and how can I aquire or create them ?

The "memdisk" file is part of Syslinux. You can download it from here. (But why not boot the floppy disk directly?)

The "floppy.img" file appears to be a floppy disk image containing a GDB stub and enough glue to make it boot, but I really have no way to know for sure.

sweetpoision wrote:
2. What is this kernel which sticks on
Quote:
booting...
called ?

"floppy.img" :wink:

sweetpoision wrote:
3. How to boot into this nothing i.e just
Quote:
booting...
? How to achieve this so that I can load programs to this machine using gdb on another machine as mentioned above?

Presumably you need a GDB stub and a wrapper of some sort to switch the CPU to protected mode and communicate over the serial port. I don't know if you need to implement any extra functionality to load your kernel through GDB remotely, I've never done that before!

sweetpoision wrote:
I tried creating a blank floppy.img using
Code:
mkfs.msdos -C myfloppy.img 1440
and also aquired memdisk from syslinux but didn't work

A blank floppy disk doesn't contain a GDB stub, but you should at least see MEMDISK display some text on the screen. If you're not even seeing the MEMDISK text, you haven't installed GRUB correctly on the hard disk image.

sweetpoision wrote:
The reason I am asking this here is that the instructor did not provide links to download those files. Please bear with me and suggest a way using which I can accomplish the above.

I suggest asking the instructor.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 162 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group