Blogs

GSOC 2011: Final Milestone Report

Blog post by antifinidictor on Mon, 2011-08-22 16:13

Hello all,

GSOC 2011 is over, and the SDL 1.3 for Haiku is over- for now.
I intend to continue working on the project, although I probably won't start again for a while, as the recent errors have been frustrating and I need to relax a bit.

The almost-most-recent-version is available at https://bitbucket.org/antifinidictor/haiku-sdl-1.3/; I had some problems with my computer and haven't been able to upload the most recent version yet, which just has some changes to which functions are static and which aren't.

Problems with the current version that I have been unable to solve:
(1) Window resizing is generating SEGFAULTs again. It hadn't been for a long time, but recently started up again. Since I don't have any regression tests, I am not sure when this error reappeared (sometime since I started working on fullscreen errors). OpenGL windows can be resized all they want.
(2) Switching to and from fullscreen (both in OpenGL and not) cause the application to somehow lose keyboard focus, or something; it remains permanently on top of all other windows, but usually doesn't respond to shortcuts. This error, to my knowledge is somewhat sporadic, and occurs most frequently with OpenGL.
(3) You cannot start normal applications in fullscreen mode (OpenGL usually works, but sometimes it doesn't). When you do, the video mode changes, and the window takes up the entire screen, but the screen is entirely white. The window responds to normal keyboard commands.
Otherwise, to my knowledge, SDL 1.3 video works for Haiku. I'll add more errors as I remember them.

I would like to thank the Haiku community for supporting GSOC 2011 projects. This was by far the most interesting work I've done to date, and I look forward to working with Haiku in the future!

Language Bindings for the C++ API: Fourth Quarter Report and Post-GSoC Goals

Blog post by jalopeura on Sat, 2011-08-20 15:56

The following classes have been implemented; some methods and functions have not been implemented due to dependencies on unimplemented classes, but the classes below are otherwise complete:

From the Application Kit: From the Interface Kit: From the Storage Kit: From the Support Kit:
Application
Clipboard
Cursor
Handler
Invoker
Looper
Message
Messenger
Alert
Box
Button
CheckBox
ColorControl
Control
Font
Menu
ListItem
ListView
MenuBar
MenuField
MenuItem
OutlineListView
Picture
PictureButton
Point
Polygon
PopUpMenu
RadioButton
Rect
Screen
ScrollBar
ScrollView
SeparatorItem
Shape
Slider
StatusBar
StringItem
StringView
TabView
TextControl
TextView
View
Window
Entry
EntryList
FindDirectory*
Mime
MimeType
Node
NodeInfo
NodeMonitor*
Path
Query
Statable
Volume
VolumeRoster
Archivable
Beep*
Errors*
TypeConstants*

*These don't actually contains any classes, Errors and TypeConstants expose constants; Beep exposes functions; FindDirectory and NodeMonitor expose constants and functions.

The following classes were partially implemented, but had bugs that could not be resolved before the end of GSoC:

Bitmap
FilePanel
ChannelControl
ChannelSlider
ColumnListView
Gradient (and derived classes)
OptionControl
OptionPopUp

The following classes from the original timeline were not implemented:

Dragger
Shelf
Region
PrintJob

My goals for the fourth quarter were:

- Fix bugs reported by users (None reported)
- Add documentation (Done)
- Write additional example programs and enhance existing ones (Done)

The generator and interface language have been documented; the documentation on the classes themselves is still limited.

Post-GSoC goals:
- Add support for keyword-style entry
- Add support for functions as parameters if possible
- Add support for templates as parameters if possible
- Continue to add new bindings
- Fix bugs as they are discovered

I don't know how long it will take me to meet these goals; now that GSoC is over, I won't be able to spend as much time on this project.

The Python extensions have not been tested very well; there are two simple programs that test the basic functionality, and those work. In addition, work on the Perl test programs exposed a number of bugs that were due to mistakes in the definition files, which means that those particular bugs were fixed for Python as well. But there are very likely a large number of Python-specific bugs that will only come to light with more testing.

As always, the files are available via the project page: http://dev.osdrawer.net/projects/perl-haiku-kits/; as requested by jrabbit, the Python extension is also available via PyPI. The Perl extension should be available on CPAN soon; I'm waiting for approval of the namespace from the maintainers.

Note: To report bugs, attach a comment here or request to be added as a project member via OsDrawer.net so you can report bugs via the project site.

Contacts Kit, quarter-term report

Blog post by Barrett on Mon, 2011-08-08 23:44

In these weeks i have improved the contacts kit core in order to have enough support for the formats supported. The vcard and people translators can now translate and exchange many types of field, though photo and groups aren't yet supported.

Main functionalities of the classes :
BRawContact
Their functionality is to deal with the BTranslatorRoster and keep track of basic informations, like the final format. The final destination is represented as a BPositionIO object. Basically the class find a suitable translator when initialized and provide two methods : Commit() and Read(). The first has as argument a BMessage that contain Flattened BContactFields, the second translate the source file (that can be a B_PEOPLE_FORMAT, B_VCARD_FORMAT, B_CONTACT_FORMAT) into a BMessage and return it.

BContact
BContact is the high level class representing a contact, it has the job to store informations about the raw contact, provide methods to add/remove/replace/compare the BContactFields. When initialized it use the BRawContact::Read() function to read fields from a location, and use BRawContact::Commit() to provide BContact::Commit().

BContactField and childs

BContactField is designed to support as well both People and VCard formats. The class is not intended to be used directly, but a common interface for the different types of fields that are supported. The usage of a field is defined by two enums at ContactDefs.h, it is a code that allow to specify additional informations for the data, for example if you want to add a phone number that is a fax you'll use this code :

...
BContactField* field = new BStringContactField(B_CONTACT_PHONE, value);
field->SetUsage(CONTACT_PHONE_FAX_WORK);
contact.AddField(field);
...

Another interesting function of BContactField is the Label() method, that return a friendly description of the field allowing to create easily apps like People without having care to translate a label for any field.

The class also accept any number of string parameters, the BFlattenable interface, and the BContactFieldVisitor interface.

BStringContactField
This is used for the major part of the fields, the value is represented as a BString object it is enough for fields like B_CONTACT_NAME, B_CONTACT_ORG...
BAddressContactField
It represent an address, allow to initialize a well-formed address via the constructor or alternatively the programmer can use the provided methods to set all the informations.

There are also other types of fields in the plans, one of these is the BCustomContactField.

Translators
As said while not supporting all fields, they can translate and exchange fields with a common format. There are some bugs, but the whole process is working as well and i consider this part of the project complete.

Services Kit
Unfortunately this side is not close to be completed, i have a draft and i'm working to get it enough complete.

At the moment the main classes are :
BServicesRoster
A simple class that allow to manage the addons in a more low-level manner...something similar to BTranslatorRoster giving access to the add-ons so nothing specific to the contacts support but a base for many uses (including contacts addons).

BServicesAddon
This will be the class specifying the API used by the addons, using a generic set of methods...version, name, friendlyname, services_addon_type, init and so more. Providing a Process() method used to receive data as BMessages from the server. In the same manner, will be instantiated with a messenger object to talk with the server.

BContactRoster,
basically store the BContacts provided in the address book. The user will instantiate an own object reading only the contacts they want. In future would be nice to see classes like BContactQuery...at the moment they will specify simple access to the fields stored in the address book. Internally will use an instance of the BServicesRoster talking with contacts addons.

I have created a git branch of the Haiku's tree at the url :

https://github.com/Barrett17/Haiku-services-branch

At the moment it is a plain copy of the tree, in the next day's i'll update the code since using the osdrawer repo was limitative.

Batiseur: not a bed and breakfast

Blog post by jrabbit on Sun, 2011-08-07 15:14

In these last few (official) weeks of Google Summer of Code I’m focusing on the meat of my project. This means that side features like the achievements, scoreboard etc will be ‘frozen’ as-is until after GSOC. I’m planning on rounding them out, just not yet. The main work will be on the builddrone working properly and testing/signing. A major but was in the camlistore python library, I’ve fixed it and will change how it works a little.

I wrote a haikuports standalone validator which can be used in an upcoming version of haikuports possibly or just for your own amusement on a simple bepfile. (Hint you could wrap this in a git-hook and then only allow a commit if your beps pass!) On the builddrone front I fixed a bunch of assumption-related bugs that came from not testing.

BONUS: WPA derived propaganda

Language Bindings for the C++ API: Third Quarter Report and Fourth Quarter Goals

Blog post by jalopeura on Sat, 2011-08-06 08:10

The following classes are now mostly implemented; there are some methods that cannot be implemented yet because they require objects that are not yet implemented, but otherwise these classes are complete.

From the Application Kit: From the Interface Kit: From the Support Kit:
Application
Clipboard
Cursor
Handler
Invoker
Looper
Message
Alert
Box
Button
CheckBox
Control
Font
Menu
ListItem
ListView
MenuBar
MenuField
MenuItem
OutlineListView
Point
PopUpMenu
RadioButton
Rect
Screen
ScrollBar
ScrollView
SeparatorItem
StringItem
StringView
TabView
TextControl
TextView
View
Window
Archivable
Errors*

*Errors doesn't actually have any classes, it merely exposes a lot of constants to the target language.

My goals and results for the last quarter:
- Continue to test threading issues (Done)
- Expand existing bindings and add new bindings (Done)
- Fix bugs reported by users (None reported)
- Enable structs (Done)
- Expose globals (Done)
- Add documentation (Partially done)
- Write additional and more complex test programs (Done)
- If there is sufficient time, select a third target language (Insufficient time)
- If there is sufficient time and user interest, work on overloaded operators (Done)

No users have reported bugs yet, but I found several of my own, including a threading problem. Perl passes arguments and fetches results via a stack. The stack is maintained by the interpreter, which lives in the main thread. When multiple threads write to the stack at the same time, the arguments and return values can end up mixed. I solved it by calling be_app->LockLooper() before doing any stack manipulation and be_app->UnlockLooper() once I was done.

I didn't uncover this bug until I was writing a complex example program, with lots of events coming back from the system. I learned enough Python to write minimal test programs, but I don't have any complex examples in Python, so there may be hidden bugs in the Python bindings. (This particular bug won't be an issue though, because Python doesn't use a stack to pass values to and from functions.)

It would be a big help if interested users were to download the bindings and try them out, especially the Python bindings. The bindings can be downloaded from the files pages on the project site (http://dev.osdrawer.net/projects/perl-haiku-kits/files). (Edit: Removed erroneous '>' from the end of the URL.)

While researching the best way to handle structs, I found a reference (http://www.parashift.com/c++-faq-lite/classes-and-objects.html#faq-7.8) which indicated that classes and structs are the same thing as far as the compiler is concerned. And some Haiku structs do in fact take constructors and methods. So since I already had a way to expose classes, I used the same method to expose structs.

I have some more partial documentation for the classes, and I have started on documentation for the generator itself.

There was no time to add additional target languages. I'd still like to, but I won't be able to fit it into GSoC.

During the rest of GSoC, I will be fixing bugs, writing documentation, and creating more code examples. I still have several groups of classes that I want to include, but I won't have time to implement them before GSoC ends. (Mostly these classes are layout-related, drawing-related, and query-related.)

Goals for the fourth quarter:
- Fix bugs reported by users
- Add documentation
- Write additional example programs and enhance existing ones

ZFS Port: Three-Quarter Term Report

Blog post by GeneralMaximus on Sat, 2011-08-06 04:46

Briefly, my goals for the three quarter term were: port libzfs, port the commandline tools zfs and zpool, and write a kernel module to communicate with userland tools via ioctl() calls on a /dev/zfs. Another goal was to make sure our port of ZFS passes all tests in ztest.

With the exception of a few missing routines, libzfs builds fine on Haiku. So does zpool. zfs requires some love, but nothing major remains to be done. In fact, with the exception of a few routines that I need to implement in libsolcompat (our Solaris compatibility library), the port builds almost perfectly on Haiku. But getting it to build is only half the battle ;)

The issue that's holding me back at the moment is that our port fails ztest, and the multithreaded nature of ZFS makes bugs extremely hard to track down and fix. For example, about a week ago ztest would fail when trying to write to disk. That turned out to be a fairly trivial issue -- wrong flags passed to an open() call because my definition of a constant was wrong -- but took me four days to track down. Now I'm facing an issue where all the threads in ztest deadlock after while and the program sits there forever, doing nothing. Since the ZFS code spawns so many threads, it's very hard to figure out where the problem originates.

I wanted to get ztest under control this week, but I failed. Now I've been studying how Solaris expects threads and synchronization primitives to behave from the excellent Solaris Internals book. I will hopefully be able to fix ztest before the next week ends and wrap up the missing routines in libsolcompat. If we pass ztest, it means the code we ported works perfectly.

My goal for the final stretch of the GSoC was to implement the ZFS POSIX Layer. That would allow us to actually perform read/write operations on ZFS partitions. Sadly, I might not have time to do this before the coding period ends, but I'll give it my best shot.

I hope to get back here with good news soon.

GSOC 2011: Three-Quarter Term Milestone Report

Blog post by antifinidictor on Fri, 2011-08-05 21:17

So far SDL 1.3 for Haiku has made significant progress. Video draws correctly both with and without opengl, audio appears to already work, and various tests provided in the SDL test suite seem to work. However, there are a few significant bugs I have come across.

The first error occurs when resizing the window. The application occasionally receives the illegal operation signal or a SEGFAULT. The illegal signal operations occurred when blitting from the backbuffer I allocated to the screenbuffer provided by BDirectWindow's DirectConnected() function. Presumably this was caused by the window being resized in the middle of a draw operation, since this error only occurred after I moved blitting to a separate thread. Before this, blitting was done in the application thread, and caused a slowdown of SDL's event handling by up to 1 second (moving around the mouse required redrawing the window). I received several suggestions to fix this error, including move the blit code back to the application thread, use mutexes, and use BBitmaps. I have since transferred drawing operations to a BBitmap object, which appears to have removed the illegal operation signal. However, resizing the window continuously will result in the occasional SEGFAULT. I only discovered this error today; I intend to investigate it further over the weekend. So far I have noted that the SEGFAULT occurs in different places on different runs, although I have not officially found a connecting pattern.

The OpenGL implementation is incomplete, but works surprisingly well, thanks to BGLView. There are problems with loading libraries, however; for some reason, the flag indicating a library was successfully loaded is being set to false. I will experiment with this error in the coming weeks, and hopefully resolve it. OpenGL also has a resizing issue where any attempt to resize the window causes the program to freeze- without setting off any errors or signals in gdb.

In addition to fixing these errors, I intend to add functionality that I missed in the process of writing the video code. For instance, many SDL flags passed to the window are not yet handled; currently only window resizing capability is used.

I intend to add to this list over the weekend, and possibly after the due date of this blog.

Note that the SDL repository I am editing is available at bitbucket.org (but I have not had access to internet this week up until today, and won't be able to upload the most recent changes until Sunday at the earliest): https://bitbucket.org/antifinidictor/haiku-sdl-1.3/

Syndicate content