1.) is it always the case, that it returns the next free segment with the lowest number?
Yes.
2.) page zero (which is at #b0, #0000-#3fff after loading): is it always the case, that only the first 256 bytes (#0000-#00ff) are used for EXOS?
It is used from 30h-5Bh.
The allocation as I think:
Do Allocate segment, until got a shared segment error (7Fh), store a list of allocated segments.
When get a shared segment error, then it is the System Segment (FFh).
Now come the trick: combine the Zero Page Segment with the System Segment.
Need to copy the system area, and also your loader program for continue the execution. And at the final need to left routines for the Warm Reset (which can restart SymbOS, for example in a all applications closed state, but possible continue anything), and a exit routine which will reverse the allocation and then exit to EXOS.
Set the User Boundary with EXOS 23, where is needed, it is depend from your program size.
If successful then copy the start of zero page to the system segment until the boundary.
Then page the system segment to page 0, and write it is address to BFFCh USR_P0 variable (page 2 address, on page 0: 3FFCh)
And finaly store the original page zero number to the start of allocated segment list.
This trick made one more continous 64K block at most of systems. But on lot of memory systems not too important.
And when you got the list of allocated segments, then select the 64K blocks, segments for Kernel, and video segments.
At the video segment need to calculate video addresses from the segment number (lower 2 bits of segment number will be the high 2 bits of video address).
Finaly give back the remaining unused segments with EXOS 25. (non-continous space, or more than 1M situation)