Page 1 of 1

Workflow questions

Posted: Sat Nov 26, 2011 11:10 pm
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?

Re: Workflow questions

Posted: Sat Nov 26, 2011 11:49 pm
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.

Re: Workflow questions

Posted: Sun Nov 27, 2011 12:00 am
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?

Re: Workflow questions

Posted: Sun Nov 27, 2011 12:11 am
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.

Re: Workflow questions

Posted: Sun Nov 27, 2011 9:44 am
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

Re: Workflow questions

Posted: Sun Nov 27, 2011 11:27 am
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

Re: Workflow questions

Posted: Mon Nov 28, 2011 2:03 am
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.

Re: Workflow questions

Posted: Wed Nov 30, 2011 2:59 pm
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