Workflow questions

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mreiland
Posts: 4
Joined: Sat Nov 26, 2011 10:48 pm

Workflow questions

Post by mreiland »

I'm thinking about playing around with OS Dev a little bit (hobby project, nothing serious), and I'm curious about optimizing my workflow if I do decide to do this.

Just as an added note, since I suspect this will be the first thing everyone asks. I've read up on the list of things to know and understand, I'm fairly solid on most of them except assembly (haven't touched it since Uni), and executable formats (never needed the info before, I can learn as I go). I understand assembly, just no practical experience with it.

So with that out of the way, my biggest concern at this point is workflow. I get *very* picky about my workflow. Minimizing the feedback loop, that sort of thing. In a perfect world I would want to be able to kick off some scripts to both build things, and to prep the HD, etc, so that simply restarting the VM will get me where I need to go. My concern is that setting things up so they'll run properly in the VM is going to be a long drawn out process, even when it's automated.

I have VMWare workstation that I use for client environments, so my initial thought is to set up a linux environment in VMWare (arch being my drug of choice), doing my dev in that environment, and then possibly having another VM inside that environment that I use to run my OS. This way I could setup whatever automated scripts I needed to in order to keep my feedback loop between writing the code, and launching the OS, as short as possible.

At this point I have a lot to learn, so I'm interested in simplicity and a quick feedback loop. With that in mind, do you guys have any specific suggestions on how best to organize a workflow?
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Workflow questions

Post by gerryg400 »

For efficiency you need to get to something like

Code: Select all

make && make install
then:-

Code: Select all

Click to start VMware
I used to have 2 VM's side by side, one with Linux to dev and another to run my OS. Then I bought a mac and built a cross-compiler so I can build my OS natively and only use VMware to run my OS.

My assembly skills are woeful. I have to check every time to see whether I need square brackets or whatever, so I use C for almost everything.
If a trainstation is where trains stop, what is a workstation ?
mreiland
Posts: 4
Joined: Sat Nov 26, 2011 10:48 pm

Re: Workflow questions

Post by mreiland »

Hey gerry, thanks for the reply.

I run Windows 7 as my main desktop OS with linux in VMWare as necessary. I've found this setup works better for me since I can have access to all of the "business" software like Office (I do freelance), and still be able to do Linux dev (Most of my work is actually Linux work).

I had considered running two VM's, one for the OS Dev, and one of the actual OS. Where I'm having trouble with a setup like that is how to build the OS in the Dev VM and push it to the OS VM all in 1 fell swoop, while having it be fast. What I mean by fast is that I'm not waiting 30 seconds or more for the process to finish. Obviously OS size will be a factor, but I think it's safe to say it's going to be small for a long time to come :)

With the 2 VM setup, how did you get the binary(s) onto the 2nd VM?
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Workflow questions

Post by gerryg400 »

VMware has shared drives. I just pointed the dev VM to a shared directory on the host and copied an iso image there. Then booted the other VM from that.

If you're serious about this, you need a cross-compiler. You can build one for Cygwin and dev on Windows.
If a trainstation is where trains stop, what is a workstation ?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Workflow questions

Post by Combuster »

gerryg400 wrote:For efficiency you need to get to something like

Code: Select all

make && make install
then:-

Code: Select all

Click to start VMware
you can make it even simpler by writing a run and a debug rule that starts the VM/emulator directly from the makefile (Actually, I have half a dozen of them for various emus/configurations, mostly bochs-based ones). I reserve the install command for maneuvering files out of the project folder (either dropping the files in the sd-card/host grub folder or writing an image to physical floppy.), and most VMs don't need an install step to actually operate
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Workflow questions

Post by Brendan »

Hi,
mreiland wrote:So with that out of the way, my biggest concern at this point is workflow. I get *very* picky about my workflow. Minimizing the feedback loop, that sort of thing.
Here's what I do...

First, I've got emulators on my development machine which boot directly from disk images in my project's directory; plus a bunch of real computers setup to boot from network (my development machine is also setup as a "network boot" server).

Then, I write a large and complicated "build utility" (in C, with pthreads) that handles *everything* extremely quickly (by avoiding lots of unnecessary work while doing as much necessary work in parallel as possible - the biggest bottleneck is typically the "tar/gzip" process it spawns to create a backup of the project while everything else is being done).

Then I create a small script that runs "make" to compile my build utility (if its source changed) and then run my build utility (which detects if anything in the project itself changed and updates everything that needs updating).

Then (in KDE) I create a keyboard macro, so that whenever I press "F12" it executes my little script that updates everything.

The end result is that I can edit some source code, then press F12, then boot the OS in a range of emulators and real machines almost instantly.

The downside is that the build utility itself takes a bit of time to develop (I'm currently in the middle of rewriting it, again). However, the amount of time it saves is insane (no need to mess with makefiles, worry about backups, maintain the web site, etc).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
mreiland
Posts: 4
Joined: Sat Nov 26, 2011 10:48 pm

Re: Workflow questions

Post by mreiland »

Brendan, thanks for the writeup, that's definitely more sophisticated than what I need at the moment.

Berkus, that seems more inline with my needs, and I think you're right, I won't be "getting out of" anything anytime soon. I'm comfortable with make and bash, so I'll probably lean on them for now (minimize the number of new things I'm dealing with). Thanks for the bochs suggestion, I think I'll go with that VM for now.

Also, my drugs of choice are vim in the console, and git :)

I think I've gotten what I was wanting out of this thread, thanks for all of the responses, they were definitely helpful to me.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Workflow questions

Post by Brendan »

Hi,

I've split this topic in "half", to separate the discussion about my build utility and everything that originated from that (compiling each source file separately, "make -j" vs. "make", version control advantages/disadvantages, spaces vs. tabs, etc) from this topic.

I hope haven't made too much of a mess of things, and it doesn't cause too much confusion.. :)


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply