flat assembler
Message board for the users of flat assembler.

Index > OS Construction > How does your OS look like?

Goto page Previous  1, 2, 3  Next
Author
Thread Post new topic Reply to topic
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 15 Nov 2013, 09:23
Quote:
If-else macros? To my knowledge, I'm the first/only one in this community who makes real macro language/s: .if/.else/.while/.repeat/etc for X86+ARM, aside from the macros included with FASM+ARM. For years, I've searched this message board and have not found any good runtime macros so I had to learn/write everything by myself. By this time, I've contributed 1,000s of unique macros.

Cool! I guess it's the toughest thing todo when you have no documentation available.
Btw as the Forum title says I'd like more people to upload their pictures of the Operating Systems.
UPDATE: My OS can now detect the MAC Address (Halts after that) That's why command is HLT. Razz
I would surely upload the source code after I get IPv4 (old though) working. Thats why it halts.
Plus I got a GUI (sort of) Working.
Images :
Image
GUI (The Pink thingy is the mouse cursor)
Image

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 15 Nov 2013, 09:23
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 15 Nov 2013, 14:54
After kicking myself on my head, reading the bloat manuals I got this!
I got a bit insane after seeing this :
Image
TCP/IP!!!!!!!!!!!!!!!!!!! Finally!
(I need to change my signature! I feel so proud! (Not good to boast about yourself.....)

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 15 Nov 2013, 14:54
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 13043
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 15 Nov 2013, 21:14
sid123 wrote:

TCP/IP!!!!!!!!!!!!!!!!!!! Finally!
(I need to change my signature! I feel so proud! (Not good to boast about yourself.....)

congratulation, =)
Post 15 Nov 2013, 21:14
View user's profile Send private message Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777 16 Nov 2013, 02:05
Dex: You've got a good heart and I appreciate that you inspire people to learn. May I offer suggestions for DexBASIC? It would take an eternity to explain all of the problems. At quick glance:

Problem: DexBASIC imm32 always produces 4 instructions even for byte values that should only take 1 instruction.
Code:
macro imm32 reg,immediate {
  mov reg,(immediate) and $FF
  orr reg,(immediate) and $FF00
  orr reg,(immediate) and $FF0000
  orr reg,(immediate) and $FF000000
}    
Solution: if/else directives to prevent pointless "orr 0's". For byte values, this macro will only produce 1 instruction instead of 4. For 16BIT, only 2 instructions. For 24BIT, 3 instructions. For constant rotation, standard mov r0, 7F000000h does this. See Magic-ARM > ldi to understand it. For PC-relative load from literal pool, see FASMARM's macros.
Code:
macro movi a, b {
 local n
 if (b)=-1 | (b)=0FFFFFFFFh
  mvn a, 0
 else if (b)>0 & (b)<255
  mov a, (b)
 else
  mov a, (b) and 0FFh
  n=(b) and 0FF00h
  if n<>0
   orr a, a, n
  end if
  n=(b) and 0FF0000h
  if n<>0
   orr a, a, n
  end if
  n=(b) and 0FF000000h
  if n<>0
   orr a, a, n
  end if
 end if
}    
Problem: DexBASIC function start + return always produces 18 instructions (72 bytes):
Code:
Macro substart                                           ;
{                                                        ;
        push   (lr)                                      ;
        push   (r4)                                      ;
        push   (r5)                                      ;
        push   (r6)                                      ;
        push   (r7)                                      ;
        push   (r8)                                      ;
        push   (r9)                                      ;
        push   (r10)                                     ;
        push   (r11)                                     ;
}       

Macro return                                             ;
{                                                        ;
        pop   (r11)                                      ;
        pop   (r10)                                      ;
        pop   (r9)                                       ;
        pop   (r8)                                       ;
        pop   (r7)                                       ;
        pop   (r6)                                       ;
        pop   (r5)                                       ;
        pop   (r4)                                       ;
        pop   (pc)                                       ;
}    
Solution: ARM can push/pop 1-16 registers in one instruction. Replace these 18 instructions (72 bytes) with 2 (8 bytes), saving 64 bytes per function:
Code:
push {r4-r11, lr} ; start
pop {r4-r11, pc}  ; return    
r12 can be preserved, as well, for the caller.

return macro can specify an optional value for r0/a1. An improved "return value":
Code:
macro return v {
 if ~v eq           ; if parameter was sent
  movi r0, v        ; or your imm32/ldr #
 end if           
 pop \{r4-r11, pc\} ; return
}    
Dex: I want to help but you have to want help. I generally never offer advice unless a person is asking for it. This case is an exception. 10,000s of users in the Raspberry PI community are seeing your macros and they're repeating these mistakes. I'm always willing to help humble beginner macro writers who want to learn.

I need help, too. I still haven't got Alex Chadwick's ARM USB driver working. Did you link to libcsud.a? Tell me how to do this and I guarantee NATIVE ARM assembler+compilers+BASIC+C+Z for RPI Smile Message me sometime.


Last edited by uart777 on 16 Nov 2013, 08:39; edited 3 times in total
Post 16 Nov 2013, 02:05
View user's profile Send private message Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777 16 Nov 2013, 02:39
sid123: Cool, I do not judge by graphics like people think. I merely provide art/icons/fonts/etc to help OS creators.
Post 16 Nov 2013, 02:39
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 16 Nov 2013, 08:51
Thanks uart777 and sleepsleep, but I guess I still have to work a lot! Sad
As for the error handler, I am now able to write the WHOLE contents of the RAM (64K) to
the floppy disk, It could be considered as a log, and is deleted after the next to
next reboot. Also it can locate the segment in which the machine was executing,
until some bad things start to happening (Note : The offsets aren't correct)
Image
And I ported MessiahAndrw's 3D Engine to POSx86 (Not much work)
Image

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 16 Nov 2013, 08:51
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 16 Nov 2013, 11:11
First here's the out come of your suggestions, see screenshots


uart777 wrote:
I need help, too. I still haven't got Alex Chadwick's ARM USB driver working. Did you link to libcsud.a? Tell me how to do this and I guarantee NATIVE ARM assembler+compilers+BASIC+C+Z for RPI Smile Message me sometime.

Oh, it seem's MR uart777, is not such a great programmer after all and he need the help of a humble beginner.
Maybe its you who is a not so humble beginner, when it comes to low level programming.


Description:
Filesize: 60.2 KB
Viewed: 13458 Time(s)

Screenshot2.png


Description:
Filesize: 46.83 KB
Viewed: 13458 Time(s)

Screenshot.png


Post 16 Nov 2013, 11:11
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 16 Nov 2013, 11:23
Dex4u: For the second problem, because it is within another macro you need to escape the closing curly bracket:
Code:
push {r4-r11, lr\} ; start
pop {r4-r11, pc\}  ; return    
Post 16 Nov 2013, 11:23
View user's profile Send private message Visit poster's website Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777 16 Nov 2013, 11:29
DexOS: LOL! Smile \'s are needed before {} inside of macros. This proves that you don't know the basics of macros and the reason I say this is because you claim to be an experienced macro writer. Thinking you already know prevents you from learning.
Code:
pop \{r4-r11, pc\}    
You're telling 10,000s of users in the Raspberry PI community that DexOS is the "fastest OS ever".

I see, my OS image was deleted.
Post 16 Nov 2013, 11:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 16 Nov 2013, 11:49
uart777 wrote:
I see, my OS image was deleted.
Is it this one?

http://board.flatassembler.net/topic.php?p=163758#163758
Post 16 Nov 2013, 11:49
View user's profile Send private message Visit poster's website Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777 16 Nov 2013, 11:54
revolution: Sorry, not on PC and didn't notice that.

DexOS: In addition, you're saving the wrong registers for that macro in the second image. Try this:
Code:
push \{r0-r5, r10\}
; ...
pop \{r0-r5, r10\}    
Oh, well, it's late. Time for bed.
Post 16 Nov 2013, 11:54
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 16 Nov 2013, 12:18
revolution wrote:
Dex4u: For the second problem, because it is within another macro you need to escape the closing curly bracket:
Code:
push {r4-r11, lr\} ; start
pop {r4-r11, pc\}  ; return    
Thanks revolution, for the info.

@uart777, i have never claim to be an experienced macro programmer, i do not use them at all, unless i have too.
I just posted some simple macro to help beginners do low level stuff on the raspberry pi.
They did the job, all worked, and lots of people used them.
Then you come along and post stuff and you do not get a single comment or download for all we know.

Maybe there's the problem, if your macro's are so great then people will flock to your supper macro's.
Stop being jealous and instead work on getting your own code working.

Remember you need my help to get your USB working, but i do not need your help as all my stuff works.
Post 16 Nov 2013, 12:18
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 16 Nov 2013, 12:20
Guys! C'mon stop arguing,
This forum is about "How does your OS look like" not "How to correctly use macros"
Anyways I released the source code : posx86.codeplex.com (Networking + 3D Engine + PCGUI2)
Note : the Mouse Driver WILL NOT WORK properly on QEMU! (Test it on Bochs,VBox,Real Hardware,VPC etc.)

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 16 Nov 2013, 12:20
View user's profile Send private message Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777 16 Nov 2013, 13:40
DexOS:
Quote:
i have never claim to be an experienced macro programmer
Outright lie. Ask anyone in the Raspberry PI community.

I do not need anyone. Unlike you, I write my own code. All of my programs are written by me alone. As for the USB driver, I don't even need Alex Chadwick (who is a good programmer by the way). All I need to learn USB programming is the book by Benjamin Lunt. Tomorrow, I'll begin creation of Super-BASIC, a real macro language for RPI created with my Magic-ARM assembler. Say good bye to DexBASIC Wink

sid123: Sorry Neutral DOS is excellent for learning.
Quote:
And I ported MessiahAndrw's 3D Engine to POSx86 (Not much work)
Manual graphics written directly to a linear VGA/matrix/buffer can be portable to ANY CPU+OS.
Quote:
I guess it's the toughest thing todo when you have no documentation available.
Yes, it is hard to learn how to write macros. The only way is by studying examples. Good luck.
Post 16 Nov 2013, 13:40
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 16 Nov 2013, 13:55
uart777 wrote:
All I need to learn USB programming is the book by Benjamin Lunt.
and if you look in the acknowledged of that book, you will see thanks to DexOS Laughing
Post 16 Nov 2013, 13:55
View user's profile Send private message Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777 16 Nov 2013, 14:00
Well, I would thank you for inspiration, not for any code you've written. It's all trash.
Post 16 Nov 2013, 14:00
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 13043
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 16 Nov 2013, 14:37
=)
i guess, competition is good,
uart777 basic vs dex4u basic, game start =)

let see how many percentage market you guys could captured,

competition is really good, it kicks in lots of motivation in some sense, only market could decide who is the winner.
Post 16 Nov 2013, 14:37
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 16 Nov 2013, 14:53
@sleepsleep
Let's take some popcorn and see who wins, This is turning into some joke or
something very serious. (Cause both are knowledgeable people)
@To the whole FASM Board
GUYS! C'mon Don't be lazy to post your OS's pic. It just takes a button (PrintSrc) on your keyboard and a Ctrl+V in your Image Editor,Save it, and upload it to a image sharer, or attach it. Your OS could be ANYTHING! Even a bootable prog. (Wait it can't be an application that runs on top of another OS)
@Tomasz Grysztar
You have given us the biggest tool to work with, a "whole" assembler, which is in fact one of the easiest assemblers to port to an OS, On OSDev when a person asks
about which assembler to use for OSDeving, FASM is always there on the list somewhere on the top. So I ask one question. Have you every thought of or have written an operating system?

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 16 Nov 2013, 14:53
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 16 Nov 2013, 15:32
sid123 wrote:
So I ask one question. Have you every thought of or have written an operating system?

Yes he has, thats what fasm was started for, i can not remember the name, but i have a copy some where, if it not on the forum i will post it.

[EDIT] It was called TitanOS
http://board.flatassembler.net/topic.php?t=153

Thats why fasm is so portable.
Note: his user name was Privalov then
Post 16 Nov 2013, 15:32
View user's profile Send private message Reply with quote
ASM-Man



Joined: 11 Jan 2013
Posts: 64
ASM-Man 16 Nov 2013, 16:58
ivan_tux wrote:
This is screenshot of my OS Very Happy[/img]
(In Indonesian Very Happy )


Very cool! Have you did it from scratch? Is all the code written by you?

_________________
I'm not a native speaker of the english language. So, if you find any mistake what I have written, you are free to fix for me or tell me on. Smile
Post 16 Nov 2013, 16:58
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.