From nobody Sun Jan 16 16:13:06 2022 X-Original-To: virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id ADC181951F3C for ; Sun, 16 Jan 2022 16:13:45 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JcKpc52Ydz3sqw for ; Sun, 16 Jan 2022 16:13:44 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: by mail-ot1-x32f.google.com with SMTP id m8-20020a9d4c88000000b00592bae7944bso13629111otf.1 for ; Sun, 16 Jan 2022 08:13:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y5+hTISWiBGKvEzDgnGLAfJ1cXBrtOi07hdcxyc+In8=; b=nA/BdjTV8WR4c6cmTnmqMAciepcY5jQ+pB6nW5dpMr6d3j5eVhZTBSmrMNWn7oTq9M hGTRFDdNo5SAZeVKFbR7wFs6W2PTN0Sc0wgVV8NRNfR37rubb7quXwQvR/PLfLWG5f/G P//uoVWtiDBfljcHtZ0nwdS53ik8OBxrZho9d+soGU7uVTwQkOOhn6t8oCYZ2/OqsszE eqD3sLKEDnuN7ucXuI9h7Vc6Csz9iwDb/Db2uzcpg/q0GQHHjc0N8dm76aZ+SCZcHZ46 RQvlnyTGj2HODWFkiZyBIqjSgYnkiMGbhmiY+N4Rvj8b+A9SinliMkO8IG95aIzpyO7f gtHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y5+hTISWiBGKvEzDgnGLAfJ1cXBrtOi07hdcxyc+In8=; b=b3BRmVntrrQG1l66Do9RQrtXJQrrdUW9IH+S3uBp9QglLUM/15G/gDG2yojjf9KvoY +co/z7TQlRsiW+ulv4AAYarzJG76Me3eOYKde2rDwRRI73TtJwxcg58A2FTsrh3btkSu YiHYPJ4Q3kfbG7HqGOq68Yzs3+M+yhrNF9Gj8juM+p9EsPJwit56hkL8TNH3ppn56WWY KaEjWaW22gaDfzqw4iN+pF4tC7AL/Eig8zYp1UfOUO/ERHFhlWUA5jOcWyjM8Yhs0H61 zAngSUjgttfQ+wuYRLHoRCNWjV9wNWUAth/w4t5yAZ4lXTZ/bsHTUn0d30UkRYX7uKth eyyg== X-Gm-Message-State: AOAM532BKcJyALFg1+RU3zkdBZAAVXxD7s/AEy4cFF/+7KBswlNCwyPB SDKMWsmSEob4q7ZaJtggesyoHRXWFGVaL8oEo2/hPoRdlO0DXg== X-Google-Smtp-Source: ABdhPJzS5EdsjW5PnC4Jyomx709c/Tt4HsMMwo06krFQIyWUUORTHSdxqlTQuSE+6TGuv7zASdkFV621ffhvmkhinOk= X-Received: by 2002:a9d:1d3:: with SMTP id e77mr12037235ote.283.1642349623424; Sun, 16 Jan 2022 08:13:43 -0800 (PST) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 References: <6B196318-29A4-479B-BC12-99EBBB69397E@iitbombay.org> In-Reply-To: <6B196318-29A4-479B-BC12-99EBBB69397E@iitbombay.org> From: Mehmet Erol Sanliturk Date: Sun, 16 Jan 2022 19:13:06 +0300 Message-ID: Subject: Re: Using bhyve to develop and OS -- tips on how? To: Bakul Shah Cc: Aryeh Friedman , virtualization@freebsd.org Content-Type: multipart/alternative; boundary="000000000000e6b9b605d5b551a8" X-Rspamd-Queue-Id: 4JcKpc52Ydz3sqw X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b="nA/BdjTV"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mesanliturk@gmail.com designates 2607:f8b0:4864:20::32f as permitted sender) smtp.mailfrom=mesanliturk@gmail.com X-Spamd-Result: default: False [0.99 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.99)[0.989]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[virtualization@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::32f:from]; MLMMJ_DEST(0.00)[virtualization]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --000000000000e6b9b605d5b551a8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jan 15, 2022 at 1:54 PM Bakul Shah wrote: > You may be better off using qemu, at least initially as =E2=80=9Clegacy= =E2=80=9D booting > requires jumping through a few more hoops. Another suggestion is to check > out wiki.osdev.org. There are a lot of useful resources on this site. > > On Jan 15, 2022, at 1:29 AM, Aryeh Friedman > wrote: > > =EF=BB=BF > I want to develop a OS completely from scratch, i.e. starting with the > first instruction encountered after POST and everything above it (mostly > for fun). > > I want to use bhyve to do this any tips on how to get started (I have > found a few tutorials on how to do the asm part of a MBR but that's about > as far as I have gotten). > > -- > Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org > > Dear Aryeh , https://wiki.osdev.org/Required_Knowledge >From the beginning of above page : " Required Knowledge If you think you can skip this, it's probably just for you. Writing an OS is not a beginner's task. In fact, writing an OS is usually considered the most difficult programming task. You will need above-average programming skills before even considering a project like this. ..... " If you want to take such a difficult road to pursue , you may do the following : Study the bug reports , or GSOC projects , or projects to be handled by the FreeBSD Foundation ( or if you want more difficult problems , please search my mailing list messages to see "crazy" ideas , or please ask me "Do you have more crazy ideas ?" . You may be sure that I can find much "more crazy" ideas for you based on my goal to write a NEW operating system mainly based on FreeBSD , but from SCRATCH for ( not "Very" but ) "Large scale software stacks ( distributed , expert system based meaning learning , etc ... . ) ) If you confine your works on FreeBSD , if you want to be able to solve its current problems , this will mean that you are knowing how to write an OS because you are knowing the FreeBSD very well and are able to modify it toward a more mature state = . At the end you will gain and FreeBSD will gain . A few suggestions : (1) Make a list of "panic" points . Eliminate as many of them as possible to protect the OS from crashing by determining whether the next application step will cause a panic or not ( check panic conditions before entering the next step ) and do not enter into it but return safely back by taking necessary actions other than "panic" . (2) At present many device behaviors are encoded into kernel related routines such as internal tables , constants , etc. . Design a device definition *.XML file format and move these internal definitions into these files with file names generated from device characteristics . For the detected existing devices and newly attached devices , generate the file name and search that file . If it exists , load it , else give a suitable error message . This allows to add new devices by the users by using device producing company supplied device definitions , or device definitions without requirement of modifications of kernel related sources . One more step would be to allow user supplied ( not "root" supplied ) device definitions and its associated device drivers loaded from userland . Such a system will be a very easy structure for the device producing companies because already they have device driver software , it is very easy to generate a device definition . The users will be able to use these devices easily by only attaching the device , storing its device driver and definition file into her / his space . This will attract the companies to be interested in FreeBSD , and produce more such drivers , definitions . This will increase number of possible FreeBSD users now repelled back due to difficulty of use of the devices or complete lack of their associated software parts , by solving their problems . It is possible to define many more improvement points . If present problems are handled , they will inspire many new improvement points which means you may continue to contribute to FreeBSD as much as possible . This will supply what you want to do and its very pleasing happiness ( with respect to my understanding of your intentions ) . With my best wishes for all , Mehmet Erol Sanliturk --000000000000e6b9b605d5b551a8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


<= div class=3D"gmail_default" style=3D"font-family:tahoma,sans-serif;font-siz= e:large">

On Sat, Jan 15, 2022 at 1:54 PM Bakul Shah <bakul@iitbombay.org> wrote:
You may be better off using qemu, at leas= t initially as =E2=80=9Clegacy=E2=80=9D booting requires jumping through a = few more hoops. Another suggestion is to check out wiki.osdev.org. There are a lot of useful r= esources on this site.

= On Jan 15, 2022, at 1:29 AM, Aryeh Friedman <aryeh.friedman@gmail.com> wrote:<= br>
=EF=BB= =BF
I want to develop a OS completely from scratch, i.= e. starting with the first instruction encountered after POST and everythin= g above it (mostly for fun).

I want to use bhyve t= o do this any tips on how to get started (I have found a few tutorials on h= ow to do the asm part of a MBR but that's about as far as I have gotten= ).

--
Aryeh M.= Friedman, Lead Developer, http://www.PetiteCloud.org
=


Dear Aryeh ,


https://wiki.osdev.org/Required_Knowledge<= /div>

From the beginning of above page :
=

"
Required Knowledge

If you = think you can skip this, it's probably just for you.

Writing an = OS is not a beginner's task.
In fact, writing an OS is usually cons= idered the most difficult programming task.
You will need above-average= programming skills before even considering
a project like this. .....
"

= If you want to take such a difficult road to pursue , you may do the follow= ing :

Study the bug reports , or GSOC pr= ojects , or projects to be handled by the
FreeBSD Foundation=
( or if you want more difficult problems , please sear= ch my mailing list messages
to see "crazy" id= eas , or please ask me "Do you have more crazy ideas ?" .
You may be sure that I can find much "more crazy" id= eas for you based on my goal to write
a NEW operating system= mainly based on FreeBSD , but from SCRATCH for
( not "= Very" but ) "Large scale software stacks (=C2=A0 distributed , ex= pert system based
meaning learning=C2=A0 , etc ... . ) )


If you confine your wor= ks on FreeBSD , if you want to be able to solve its current problems ,
=
this will mean that you are knowing how to write an OS beca= use you are knowing
the FreeBSD very well and are able to mo= dify it toward a more mature state .
At the end you will= gain and FreeBSD will gain .


A few suggestions :

(1) Ma= ke a list of "panic" points .
=C2=A0=C2=A0=C2=A0= =C2=A0 Eliminate as many of them as possible to protect the OS from crashin= g by determining
=C2=A0=C2=A0=C2=A0=C2=A0 whether the next a= pplication step will cause a panic or not ( check panic conditions
=C2=A0=C2=A0=C2=A0=C2=A0 before entering the next step ) and do not = enter into it but return safely back by taking
=C2=A0=C2=A0= =C2=A0=C2=A0 necessary actions other than "panic" .

(2) At present many device behaviors are encoded into= kernel related routines
=C2=A0=C2=A0=C2=A0=C2=A0 such = as internal tables , constants , etc. .
=C2=A0=C2=A0=C2= =A0=C2=A0 Design a device definition=C2=A0 *.XML file format and move these= internal definitions
=C2=A0=C2=A0=C2=A0=C2=A0 into the= se files with file names generated from device characteristics .
=C2=A0=C2=A0=C2=A0=C2=A0 For the detected existing devices and newly a= ttached devices , generate the file
=C2=A0=C2=A0=C2=A0= =C2=A0 name and search that file . If it exists , load it , else give a sui= table error message .
=C2=A0=C2=A0=C2=A0=C2=A0 This allows t= o add new devices by the users by using device producing company
=
=C2=A0=C2=A0=C2=A0=C2=A0 supplied=C2=A0=C2=A0=C2=A0 device defini= tions=C2=A0 , or device definitions without requirement of
= =C2=A0 =C2=A0=C2=A0 modifications of kernel related sources=C2=A0 .
=C2=A0=C2=A0=C2=A0=C2=A0 One more step would be to allow user suppl= ied ( not "root" supplied ) device definitions
=C2= =A0=C2=A0=C2=A0=C2=A0 and its associated device drivers loaded from userlan= d .

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Such = a system will be a very easy structure for the device producing companies
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 because already they have devi= ce driver software , it is very easy to generate a
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 device definition . The users will be able to use the= se devices easily by only
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 att= aching the device , storing its device driver and definition file into her = / his space .

=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 This will attract the companies to be interested in FreeBSD , and pr= oduce more
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 such drivers , def= initions .
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 This will increase= number of possible FreeBSD users now repelled back due to difficulty of
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 use of the devices or complete = lack of their associated software parts , by solving
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 their problems .


It is possible to define many more improvement po= ints .

If present problems are handled ,= they will inspire many new improvement points
which me= ans you may continue to contribute to FreeBSD as much as possible .

This will supply what you want to do and its ve= ry pleasing happiness ( with respect to my
understanding of = your intentions ) .



With my best wishes for all ,

Mehmet Erol Sanliturk


=


=C2=A0
--000000000000e6b9b605d5b551a8--