From nobody Sun Jan 16 17:59:00 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 DCEAE19659F5 for ; Sun, 16 Jan 2022 17:59:19 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) (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 4JcN8Q5zFJz3MxP for ; Sun, 16 Jan 2022 17:59:18 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: by mail-yb1-xb2a.google.com with SMTP id n139so9492350ybg.0 for ; Sun, 16 Jan 2022 09:59:18 -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=YFbeXbTYuPKejX7+IqTdGvyujGtlI0c5c8wE7kuqkps=; b=IuK/IJLbSb88d8+CevBzjdTJw/VPYgIOQ4eZM6KKimmHkJ2yoxL9KsUbE+OVMfXb63 lFXO3hbrB3nVaO/bervSEBrJ2h4e+ZAwJ9D5Y046bw0U9YCfkueQlTmkvV4bGokRkVqw VfvPG501aDgZ11NI75Kpm26SQosMBuHahDFYC8pC4COdPmdxcTrQ2v8j1zT8C7vw0TdG +e3zdo9fYyisaBYl4LcG+4TfibIEh+oyoffgrJEZPaY0C8Zp1QSWQspjFuhcokt81Q/Z TaRTOkvoD2yrALlvCLPl1WmUHcp+l+swQAUh5P43ZVyxPPmkUooOzVf+jZY7FObnLnnp I1tg== 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=YFbeXbTYuPKejX7+IqTdGvyujGtlI0c5c8wE7kuqkps=; b=IfLyIUZBFiSjMYI7f2TOsK5DpoaI7kJv5IsO/MRyIecZSVyhDc64SxjRDAawdbz/1v auSfbWMo6BTYLQ0XPqQa1Wth4GaAus/lFJFEMGHrY+gzkkoKNGniC/XH0k4zNKxspNEe opLG1/a0SVfH+fgrJ+aHHonac0xToZz78J1+/LITweQn85bR8sKMjysRJtWs9yzbH5QY 2Iv8LanUeJskd+x/Hee2mNUfH+o33WD74hgxUN/HcAgVOBdLBCyMC230XMhMs+rMXFFO jfRy78c+wvrjT8Eq4Miz5Kp9qTgM9SZYtUwDcviil2a3LhIX6ak5odSU/+T1jyhpYbLj mvNA== X-Gm-Message-State: AOAM531uGRL7+iTWb0UyDb8enVg/jhJUN3SBUwUgqGizuqujJ3Nl0/51 8zBQc4LlnjC6faBUTL0Y0I2IZPVJMFNMjZNdevDhg2Ux X-Google-Smtp-Source: ABdhPJw5X3tuZuAjdyAKcKUX4H16dJo41mKQW3r/5Qw3h1BKq2vUVWfbLG9Mrto+TS85Qu09eq27RiZTN/4vlltOVYw= X-Received: by 2002:a25:99c7:: with SMTP id q7mr23479566ybo.355.1642355951793; Sun, 16 Jan 2022 09:59:11 -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: From: Aryeh Friedman Date: Sun, 16 Jan 2022 12:59:00 -0500 Message-ID: Subject: Re: Using bhyve to develop and OS -- tips on how? To: Mehmet Erol Sanliturk Cc: Bakul Shah , "freebsd-virtualization@freebsd.org" Content-Type: multipart/alternative; boundary="00000000000019f91505d5b6cbe6" X-Rspamd-Queue-Id: 4JcN8Q5zFJz3MxP X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b="IuK/IJLb"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of aryehfriedman@gmail.com designates 2607:f8b0:4864:20::b2a as permitted sender) smtp.mailfrom=aryehfriedman@gmail.com X-Spamd-Result: default: False [0.55 / 15.00]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[gmail.com]; 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(-0.98)[-0.985]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.53)[0.530]; 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::b2a:from]; MLMMJ_DEST(0.00)[virtualization]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --00000000000019f91505d5b6cbe6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It was/is off topic to discuss the motivations on the design I have in mind but after thinking for it over 10 years (and using FreeBSD to build a IaaS around bhyve) I have come to the conclusion that *NO* existing OS can meet the design requirements I have in mind. On Sun, Jan 16, 2022 at 11:13 AM Mehmet Erol Sanliturk < m.e.sanliturk@gmail.com> wrote: > > > > > 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 chec= k >> 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 abou= t >> 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 t= he > 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 it= s > 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 stat= e > . > 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 crashin= g > 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 interna= l > 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 producin= g > 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 producin= g > 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 fil= e > 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 > > > > > > --=20 Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org --00000000000019f91505d5b6cbe6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It was/is off topic to discuss the motivations on the desi= gn I have in mind but after thinking for it over 10 years (and using FreeBS= D to build a IaaS around bhyve) I have come to the conclusion that *NO* exi= sting OS can meet the design requirements I have in mind.

On Sun, Jan 16= , 2022 at 11:13 AM Mehmet Erol Sanliturk <m.e.sanliturk@gmail.com> wrote:




On Sat, Jan 15, 2022= at 1:54 PM Bakul Shah <bakul@iitbombay.org> 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. Anoth= er 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 <aryeh.friedman@gmail.com> wrote:

<= /div>
=EF=BB=BF
<= div>I want to develop a OS completely from scratch, i.e. starting with the = first instruction encountered after POST and everything above it (mostly fo= r 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 Devel= oper, http://www.P= etiteCloud.org


Dear Aryeh ,
<= br>

https://wiki.osdev.org/Required_Knowledge

From the beginning of above page :

"
Required Knowledge

If you thi= nk 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 conside= red the most difficult programming task.
You will need above-average pr= ogramming skills before even considering
a project like this. .....
"

If y= ou want to take such a difficult road to pursue , you may do the following = :

Study the bug reports , or GSOC proj= ects , or projects to be handled by the
FreeBSD Foundation <= br>
( or if you want more difficult problems , please search= my mailing list messages
to see "crazy" idea= s , or please ask me "Do you have more crazy ideas ?" .
You may be sure that I can find much "more crazy" idea= s for you based on my goal to write
a NEW operating system m= ainly based on FreeBSD , but from SCRATCH for
( not "Ve= ry" but ) "Large scale software stacks (=C2=A0 distributed , expe= rt system based
meaning learning=C2=A0 , 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 becaus= e you are knowing
the FreeBSD very well and are able to modi= fy it toward a more mature state .
At the end you will g= ain and FreeBSD will gain .


A few suggestions :

(1) Make= 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 crashing b= y determining
=C2=A0=C2=A0=C2=A0=C2=A0 whether the next appl= ication 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 ent= er 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 k= ernel 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 in= ternal definitions
=C2=A0=C2=A0=C2=A0=C2=A0 into these = files with file names generated from device characteristics .
=C2=A0=C2=A0=C2=A0=C2=A0 For the detected existing devices and newly atta= ched 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 suitab= le error message .
=C2=A0=C2=A0=C2=A0=C2=A0 This allows to a= dd 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 definitio= ns=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 supplied= ( not "root" supplied ) device definitions
=C2=A0= =C2=A0=C2=A0=C2=A0 and its associated device drivers loaded from userland .=

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Such a s= ystem 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 device = 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 these = devices easily by only
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 attach= ing the device , storing its device driver and definition file into her / h= is space .

=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 This will attract the companies to be interested in FreeBSD , and produ= ce more
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 such drivers , defini= tions .
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 This will increase nu= mber 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 lac= k 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 point= s .

If present problems are handled , th= ey 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 you= r intentions ) .



With my best wishes for all ,

Mehmet Erol Sanliturk




=C2=A0


--
Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.or= g
--00000000000019f91505d5b6cbe6--