OS death x 2

if((argv = loader_copy_argv(filename, page)) == NULL)
{
lprintf_kern("argv is null %p", argv);
return ERROR;
}

outputs
argv is null 0x1ffe00

Don’t you love it when you override your program’s execution code and cause weird things like this?

Also, you get funness like getting odd addresses like 0xacfffffe because something does a INC %esp assembly instruction.

-_-
It is 2:30 AM, and we’re almost back to the point where we were logical yesterday morning before this horribleness with VM began.
*sighs*

Tonight is likely going to be another all-nighter (after which, with luck, we will be back at the point where we were at the beginning of the week). Tomorrow is more OS followed by a flight to Connecticut in the evening (yay sleeping on the plane). Death.

Edit: 8 is amazing… as I sat around uselessly throughout the night, he fixed our VM/PM bugs and got us back to a working state. Then, as I sat there and zoned out and then dozed off, he wrote the vanish() syscall and most of wait(). Bleh, why am I so useless?
My throat hurts…. I should go find some cough drops or something.

OS

Last night I was up coding until 7 AM. A lot of the time was spent fixing compiler errors, and then tracking down a bug caused by using the wrong variable in one place, causing page table entries to get overridden… causing problems later.

Today, it was my turn to have a huge bug in my code, and mine was a conceptual error (although, to be fair, it was one both of us missed).
We decided to start the first two tasks for the kernel by writing a kernelland fork function, which works much like the user version. The user version copies over all of memory except for kernel memory, creating a new kernel stack for the child and putting only the necessary stuff on there (IRET foo and registers).
I did the same thing for the kernel version, except I don’t copy any memory (since there is nothing in userspace yet). I create a new kstack and copy over only the necessary values… the return address (to return to the previous calling function) and registers.

See the problem yet?

Turns out I forgot to take into account that execution in kernelland uses the kstack… and so maybe continuing execution in kernelland (as we do by using the same return address) would need things on the stack. As a result, we kept getting the strangest errors where memory was being overridden in various ways (since the function we return to expects certain things at esp+16, and expects ebp+4 to have arguments and such). So yeah. That bug took a good 3 hours to track down. Oops.

I had a Google interview today. I feel like I did well at the data structures/coding portion, but I completely bombed the algorithms part. It seriously makes me wonder how I managed to get an A in algo class. Or maybe I’ve just forgotten everything since then. Meh.

Whee… now it’s time to debug userspace exec and fork. Fun fun fun?

Edit: 5:30 AM. Looks like it’s going to be another all-nighter. We really should start working more earlier in the week so we’re not stuck doing a bunch of stuff the night of the deadline.

Edit edit: 6 AM and fork works! Huzzah. Turns out the problem wasn’t at all in my code (which was surprisingly, given the complexity of the mapping of multiple physical pages into and out of a virtual address space, correct the first time) but rather with the TLB keeping around “stale” entries. Oops. Now let’s get exec working (and maybe bed after that).

Edit edit edit: 9 AM. Mission failed. We didn’t manage to get exec working (although it now does return to userland and run for a bit, albeit incorrectly, before being context-switched away and page faulting on its next run). Hopefully we’ll have it done today.

Work day 29

Work today was actually really interesting and fun… and the day went by rather quickly too, which was awesome.
I spent the day working on some JUnit tests. In the process, I feel like I learned a lot more about how the system as a whole works… I mean, I’m still asking a lot of questions of other people, but at least my questions now aren’t idiotic questions, but are actually decently put-together and whatnot.
Also, I learned that Java reflection is horrible and can do amazingly bad things… for example, you can access a class’ private variables indirectly through reflection (I needed to access a private boolean in a certain instance, and modifying that code would have been less than ideal).
Ew. Ew. Ew.
At least it was nicer than what I was doing before, which involed multiple runtime casts and a stack of something like 8 method calls, along with hardcoded values.

Um, yeah.
Foooooooooooooom.

Work day 16

Ever have one of those days where everything goes wrong and nothing you do turns out right?

Got to work this morning to an email that a UI bug fix that I had done last week had some problems and opened up some new issues. My mentor/unofficial-boss-person Seth (who is awesome and helpful, BTW) listed a bunch of things that he had found wrong with very simple testing. I hadn’t tested my fix nearly rigorously or thoroughly enough. Blah. That meant that the other fixes I had done were probably similarly broken and sucking.
In any case, I worked on that issue for a bit and wasn’t really able to fix some of the stuff and ended up opening some more bug reports for various things wrong with the interface (which, thankfully, weren’t due to my fix). UI work was annoying, and I couldn’t get things to work right, and I got frustrated, and gaah.

Then I moved some of my earlier fixes from last week into a new task branch, because I had been performing them against CORE, and bug fixes here are done on branches and then integrated back into CORE. I felt stupid again for not having branched off in the first place, especially because there were very explicit, very well-written instructions for doing so that I had been explicitly pointed to prior to my starting bug fixes. This took a while and I felt stupid.

Then I had to do a ton of fixing because I had combined 3 separate bug fixes into the single task branch, which is bad (I hadn’t wanted to go through the files and separate the ones associated with each bug, but Seth told me to split them up into their appropriate branches, so I went through and did that.

Then we discovered I had been branching off of MAIN rather than CORE because I had copied the branch instructions from the company wiki and hadn’t realized I was using the wrong one. I had to then go back and rework 9 task branches worth of files, modifying each branch and then resyncing each file (and integrating the changes in CORE that hadn’t been present in MAIN) in each of the branches. I felt so stupid. I mean, sure this is my first time really using a revision control system, but I really feel like I should have picked things up quicker, or at least realized I was doing something wrong when some changes I had commited to CORE earlier weren’t being picked up in my branches.
So yeah, that took a bunch of time that was wasted.

Also, I never did manage to fix the blocking-calls-in-Swing-thread bug that I’d been looking at for most of yesterday. I ended up opening another bug (which ended up being a duplicate of an existing bug because my searching skills fail and I am dumb) for it and didn’t do anything else with it.

Then, after some more tinkering with the UI and still not being able to get it to be correct (although I did manage to fix some errors such as being able to delete the last workspace in the list), I gave up on that and started on documenting some other classes (complementary to the documentation I did last week). I emailed Seth to make sure I was documenting things right, and it took 6 emails because I was being dumb again and apparently have to have things explained to me over and over and over…

So yeah, I feel like I annoyed Seth with my mishaps and ignorance and stupidity… and I feel like my technical skills are severely lacking… and I feel like I pick things up way, way too slowly (I’ve been working now for 4 weeks… spent 2 weeks with the codebase… why am I still having so many problems?)… and like my programming skills are sub-par… and generally that everyone in the company is so much smarter and more efficiet than I am and I’m just a terrible employee.
*sighs*
Goddamn it.


On the plus side of everything, non-work is going extremely well and makes me happy beyond words.
But gah, why am I so stupid?